How to substract months with EOM respect ?
古いコメントを表示
Hi, I would like to know if there is solution to substract months with respect of the End of Month flag. I've tried addtodate() and addMonth() functions but it's not giving me the wanted results.
Here is an exemple : If today's date is 31/01/14 and if I substract 2 months, I'd like as a result the 30/11/2013 and not the 01/12/2013. In the meantime,I like that if today's date is 28/02/2014 and if I substract 2 months, I'd like as a result the 28/12/2013 and not the 31/12/2013 (as addMonth function do).
Many thanks in advance, Regards, Paul
採用された回答
その他の回答 (1 件)
Mischa Kim
2014 年 1 月 21 日
0 投票
Hello Paul, there is no function out of the box that does that, as far as I know. You could use the eomday function with a bit of logic. As an alternative you might want to check on File Exchange .
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!