How can I add serial date and time for each 12 min ?

1 view (last 30 days)
Hello All,
I have date and time like: (2009 10 09 12 36 00), I would like to make a serial date and time that increase each 12 min (that means 36 min will be 48 00 12 24 .....)to date and time for example (2009 10 10 22 24 00).
Please any help: Thanks in advance,
Riyadh

Accepted Answer

Steven Lord
Steven Lord on 2 Dec 2016
Take a look at this documentation page for some examples of how to do what you want using datetime and duration arrays.

More Answers (2)

Walter Roberson
Walter Roberson on 2 Dec 2016
For serial dates, use addtodate()
For datetime objects, you can
Starting_datetime + minutes(12:12:60)
  3 Comments

Sign in to comment.


Andrei Bobrov
Andrei Bobrov on 3 Dec 2016
Edited: Andrei Bobrov on 3 Dec 2016
a =datetime([2009, 10, 09, 12, 36, 00;2009 10 10 22 24 00])
out = a(1) + (0:minutes(12):diff(a))'
or
a = datenum([2009, 10, 09, 12, 36, 00;2009 10 10 22 24 00])
out = datestr(datenum(2009,10,09,12,(36:12:diff(a)*24*60)',0))

Categories

Find more on Dates and Time in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by