Calculation of New Date using a Reference Date and Time Elapsed

I want to calculate the new date using a reference date and time elapsed. Let's say
Reference Date: 2014-07-24 15:32:45 Time Elapsed: 7852 seconds
New Date: Reference Date + Time Elapsed
How to do the same in R2014a
Thanks
Srikanth

 採用された回答

Mischa Kim
Mischa Kim 2014 年 11 月 28 日

0 投票

Srikanth, you could use the addtodate function
new_date = datestr(addtodate(datenum('2014-07-24 15:32:45'),7852,'sec'))

2 件のコメント

Srikanth
Srikanth 2014 年 11 月 28 日
Thanks, It did the work
Titus Edelhofer
Titus Edelhofer 2014 年 11 月 28 日
Hi Srikanth,
if it works, fine. Please mark the question then as answered ...
Thanks,
Titus

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

製品

質問済み:

2014 年 11 月 28 日

コメント済み:

2014 年 11 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by