Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Date & Time > DateList >

DateList

DateList
gives the current local date and time in the form .
DateList[time]
gives a date list corresponding to an AbsoluteTime specification.
DateList
converts a date list to standard normalized form.
DateList
converts a date string to a date list.
DateList
gives the date list obtained by extracting elements from .
  • DateList uses whatever date and time have been set on your computer system. It performs no corrections for time zones, daylight saving time, etc.
  • DateList[TimeZone -> z] gives the date and time inferred for time zone z by assuming that your computer is set for the time zone specified by $TimeZone. »
  • All values returned by DateList are integers, except the number of seconds. The number of seconds is never more accurate than $TimeUnit.
  • Shorter lists can be used in DateList: {y} is equivalent to , to , etc.
  • Values of m, d, h, m, s outside their normal ranges are appropriately reduced. Noninteger values of d, h, m, s can also be used. »
  • In the form DateList the can be , , , , , , , , , , , , or .
  • DateList uses the to fill in elements of . Those not filled in are taken to have default values , where is the current year. »
  • In DateList, the are extracted from in the order given, and can be separated by any non-alphanumeric characters. »
  • DateList extracts elements using the explicit separators specified. »
Find the current date:
Convert an absolute time to a date list:
Expand an elided date list:
Convert a date string to a date list:
Specify date elements for converting a string:
Find the current date:
In[1]:=
Click for copyable input
Out[1]=
 
Convert an absolute time to a date list:
In[1]:=
Click for copyable input
Out[1]=
 
Expand an elided date list:
In[1]:=
Click for copyable input
Out[1]=
 
Convert a date string to a date list:
In[1]:=
Click for copyable input
Out[1]=
 
Specify date elements for converting a string:
In[1]:=
Click for copyable input
Out[1]=
Date lists are converted to standard normalized form:
Strings are automatically interpreted when possible:
Separators are assumed if not specified:
Give explicit separators:
Day, hour, minute, and second values can be nonintegers:
The current year is used if not specified in a string:
Give explicit date elements to interpret ambiguous strings:
Find the current date in Greenwich, United Kingdom:
Specify interpretation of a string in a standard format:
AbsoluteTime represents dates as seconds since the beginning of 1900:
DateList represents dates as lists of date elements:
DateString represents dates as strings:
Use DateListPlot to plot data with date list coordinates:
Use DatePlus to add time units to a date list:
Use DateDifference to find the number of time units between dates:
Use Order to determine the order of dates:
The canonicalization performed by DateList is significant:
Year and month must be integers because the lengths of years and months vary:
There is no
0^(th)
month or day:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF