Date & Time

The Wolfram Language has a highly flexible system for representing dates and times symbolically and performing computations on them. It can also input and output dates and times in a wide range of formats, as well as handle all standard calendars.


DateObject an object representing a date

TimeObject an object representing a time of day

Now current date and time

DateString current or specified date as a string in many possible formats

"DateTime"  ▪  "MonthName"  ▪  "DayName"  ▪  "Hour24"  ▪  ...

$DateStringFormat default date string format

DateList date elements as numbers in {y,m,d,h,m,s} format

AbsoluteTime absolute time in seconds

Clock real-time dynamic clock variable

Time Zones »

LocalTime local time at any location

LocalTimeZone  ▪  TimeZoneConvert

TimeZoneOffset numeric offset between different time zones

$TimeZone resettable default time zone

$SystemTimeZone time zone used by your system

$TimeZoneEntity resettable time zone entity corresponding to your locale

Elements of Dates

DateValue extract year, month, day, hour, etc. from dates

DayName determine day of the week

Monday  ▪  Tuesday  ▪  Wednesday  ▪  Thursday  ▪  Friday  ▪  Saturday  ▪  Sunday

Date Operations

DateRange generate a list of dates

DatePlus add or subtract days, weeks, etc. in a date list or string

DateDifference find the difference in days, weeks, etc. between two dates

DateBounds find the first and last dates from a list of dates

CalendarConvert convert a date from one calendar to another

TimeZoneConvert convert between different time zones

LeapYearQ determine if the date is in a leap year

DateObjectQ test if an expression is a valid date object

TimeObjectQ test if an expression is a valid time object

Nearest find nearest dates or times in a list

Day Operations

Today  ▪  Tomorrow  ▪  Yesterday

DayRange generate a list of days

DayPlus add or subtract days

DayRound round to the nearest day of a specific type

DayCount compute the difference between days

DayMatchQ determine the day type

BusinessDayQ determine if the day is a business day

CalendarData discover available calendars

Astronomical Information »

Sunrise, Sunset time of sunrise, sunset for any location

DaylightQ  ▪  SunPosition  ▪  MoonPosition  ▪  MoonPhase  ▪  SiderealTime  ▪  ...

JulianDate  ▪  FromJulianDate

Visualization & Analysis

TimelinePlot display dates and times on a timeline, with labels, etc.

DateHistogram generate a histogram of dates or times

DateListPlot, DateListLogPlot plot data associated with dates in any format

DateListStepPlot plot data associated with dates as a series of steps

TimeSeries  ▪  EventSeries  ▪  TimeSeriesModelFit  ▪  ...

Date Import/Export

Interpreter interpret a string as a date, potentially with semantic transformations

"Table"  ▪  "XLS"  ▪  "MDB"  ▪  "ApacheLog"  ▪  "MBOX"  ▪  ...

DatePattern date pattern for string manipulation

"XLS"  ▪  "ApacheLog"  ▪  "MBOX"

UnixTime  ▪  FromUnixTime

CPU Timing »

Timing  ▪  AbsoluteTiming  ▪  TimeConstrained  ▪  SessionTime  ▪  ...

Scheduled Tasks »

ScheduledTask represent a task scheduled to run at particular times

RunScheduledTask  ▪  ScheduledTasks  ▪  ...

Translate this page: