Calculation of New Date using a Reference Date and Time Elapsed

조회 수: 2 (최근 30일)
Srikanth
Srikanth 2014년 11월 28일
댓글: Titus Edelhofer 2014년 11월 28일
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일
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개)

카테고리

Help CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by