# How to make a time slider like Manipulate[n,{n,1,20,1}]?

I want to make a time slider varied from 12:00:00 Jan 1,2015 to 22:30:00 Jan 1,2015 for every 5 minute.

So like using Manipulate[n,{n,1,20,1}],

Manipulate[tt,{tt,{2015,1,1,12,0,0.},{2015,1,1,22,30,0.},{0,0,0,0,5,0.}}]


but it doesn't work! Any idea?

• This may give a quick hint Manipulate[ DateObject[date], {date, DateRange[{2015, 1, 1, 12, 0, 0.}, {2015, 1, 1, 22, 30, 0.}, Quantity[5, "Minutes"]]}] You can of course pull most of the code into the manipulate function rather than in the manipulate range specification for date. Commented Mar 31, 2015 at 15:03
• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. Commented Mar 31, 2015 at 15:16

It could be as simple as this:

Manipulate[
DateString[t], {t, DateObject[{2015, 1, 1, 12, 0}],
DateObject[{2015, 1, 1, 22, 30}], Quantity[5, "Minutes"]}]


Using DateObjects rather than a List to indicate a date & time seems to work.

• It works! Thanks a lot! Commented Mar 31, 2015 at 15:40

I can't test this right now but I think this will work.

basetime = AbsoluteTime[{2015,1,1,12,0,0}];
max = AbsoluteTime[{2015,1,1,22,30,0}];
Manipulate[
DateList[basetime + millis],
{millis, 0, max, 300000}]

• There's at least one typo in there. Commented Mar 31, 2015 at 15:25
• Is there? I can't see any but I'm also from mobile right now Commented Mar 31, 2015 at 15:53