Date[]
returns the current date of local system, Date[1]
returns {2012, 11, 15, 17, 41, 0.3161629}, Date[2]
returns {2012, 11, 15, 18, 41, 0.3161629}, and Date[3]
returns {2012, 11, 15, 18, 41, 0.3161629} and so on and why?
Also, I tried this code
a = DateList[] (*line 1*)
a = a + {0, 0, 0, 1, 0, 0} (*Line 2*)
After executing Line 2 for a few more times I get {2012, 11, 15, 25, 41, 0.3161629}. How can I fix this as I want to use increment time by 1 hour or 30 min in a For
loop
Date[]
is deprecated; any reason why you need to use it instead ofDateList[]
? $\endgroup$Date
documentation "Date
has been superseded byDateList
since Version 6.0." and it says first argument is timezone, i.e. how many hours away from GMT. I recommend using DateList $\endgroup$DatePlus
when adding to a date (seeDateDifference
too) $\endgroup$