DateList
✖
DateList
Details and Options

- DateList[] uses whatever date and time have been set on your computer system. It performs no corrections for time zones, daylight saving time, etc.
- In DateList[date], the following date and time specifications can be given as date:
-
date DateObject specification {y,m,d,h,m,s} DateList specification time AbsoluteTime specification "string" DateString specification {"string",fmt} date string formed from the specified format - 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. »
- Shorter lists can be used in DateList[{y,m,…}]: {y} is equivalent to {y,1,1,0,0,0}, {y,m} to {y,m,1,0,0,0}, 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. »
- You can compare two lists returned by DateList using NumericalOrder. »
- In the form DateList[{"string",{"e1","e2",…}}], the "ei" can be "Year", "YearShort", "Quarter", "Month", "MonthName", "Day", "DayName", "Hour", "Hour12", "AMPM", "Minute", "Second", or "Millisecond".
- DateList[{"string",{"e1","e2",…}}] uses the "ei" to fill in elements of {y,m,d,h,m,s}. Those not filled in are taken to have default values {yc,1,1,0,0,0}, where yc is the current year. »
- In DateList[{"string",{"e1","e2",…}}], the "ei" are extracted from "string" in the order given, and can be separated by any non-alphanumeric characters. »
- DateList[{"string",{"e1","sep12","e2","sep23",…}}] extracts elements using the explicit separators specified. »
Examples
open allclose allBasic Examples (6)Summary of the most common use cases

https://wolfram.com/xid/0e7pb1bu-ncn

Convert a date object to a date list:

https://wolfram.com/xid/0e7pb1bu-fopg3b

Convert an absolute time to a date list:

https://wolfram.com/xid/0e7pb1bu-pon5gz


https://wolfram.com/xid/0e7pb1bu-dpzg74

Convert a date string to a date list:

https://wolfram.com/xid/0e7pb1bu-h1c44y

Specify date elements for converting a string:

https://wolfram.com/xid/0e7pb1bu-bza6ag

Scope (6)Survey of the scope of standard use cases
Date lists are converted to standard normalized form:

https://wolfram.com/xid/0e7pb1bu-beccom

Strings are automatically interpreted when possible:

https://wolfram.com/xid/0e7pb1bu-p2038


https://wolfram.com/xid/0e7pb1bu-eptssw

Separators are assumed if not specified:

https://wolfram.com/xid/0e7pb1bu-c2j9fo


https://wolfram.com/xid/0e7pb1bu-goqhop

Day, hour, minute, and second values can be nonintegers:

https://wolfram.com/xid/0e7pb1bu-mpvi5s


https://wolfram.com/xid/0e7pb1bu-kqxw4m

The current year is used if not specified in a string:

https://wolfram.com/xid/0e7pb1bu-hv4zf

Generalizations & Extensions (1)Generalized and extended use cases
Options (1)Common values & functionality for each option
Applications (1)Sample problems that can be solved with this function
Properties & Relations (4)Properties of the function, and connections to other functions
DateObject represents a date specification:

https://wolfram.com/xid/0e7pb1bu-0i50s8

AbsoluteTime represents dates as seconds since the beginning of 1900:

https://wolfram.com/xid/0e7pb1bu-ebkq3j

DateList represents dates as lists of date elements:

https://wolfram.com/xid/0e7pb1bu-hrn6ar

DateString represents dates as strings:

https://wolfram.com/xid/0e7pb1bu-75fzm

Use DateListPlot to plot data with date list coordinates:

https://wolfram.com/xid/0e7pb1bu-b4ix4u

Use DatePlus to add time units to a date list:

https://wolfram.com/xid/0e7pb1bu-iaxrh8

Use DateDifference to find the number of time units between dates:

https://wolfram.com/xid/0e7pb1bu-sm1p8

Use NumericalOrder to determine the order of dates:

https://wolfram.com/xid/0e7pb1bu-eucphe


https://wolfram.com/xid/0e7pb1bu-dvcqk9

The canonicalization performed by DateList is significant:

https://wolfram.com/xid/0e7pb1bu-byargg


https://wolfram.com/xid/0e7pb1bu-hsfcvd

Possible Issues (2)Common pitfalls and unexpected behavior
Year and month must be integers because the lengths of years and months vary:

https://wolfram.com/xid/0e7pb1bu-hrax41



https://wolfram.com/xid/0e7pb1bu-3jqas



https://wolfram.com/xid/0e7pb1bu-cvyd23


https://wolfram.com/xid/0e7pb1bu-dhtbc4

Wolfram Research (2007), DateList, Wolfram Language function, https://reference.wolfram.com/language/ref/DateList.html (updated 2014).
Text
Wolfram Research (2007), DateList, Wolfram Language function, https://reference.wolfram.com/language/ref/DateList.html (updated 2014).
Wolfram Research (2007), DateList, Wolfram Language function, https://reference.wolfram.com/language/ref/DateList.html (updated 2014).
CMS
Wolfram Language. 2007. "DateList." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DateList.html.
Wolfram Language. 2007. "DateList." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/DateList.html.
APA
Wolfram Language. (2007). DateList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DateList.html
Wolfram Language. (2007). DateList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DateList.html
BibTeX
@misc{reference.wolfram_2025_datelist, author="Wolfram Research", title="{DateList}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/DateList.html}", note=[Accessed: 27-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_datelist, organization={Wolfram Research}, title={DateList}, year={2014}, url={https://reference.wolfram.com/language/ref/DateList.html}, note=[Accessed: 27-April-2025
]}