gives the specified element of the current date and time.


gives a list of the specified elements of the current date and time.


gives the specified element of the specified date.


gives the result in the specified form.


  • Possible elements include:
  • "Year"full year (e.g. 2015)
    "YearShort"twodigit year (e.g. 15)
    "YearUnsigned"year without a sign
    "YearRomanNumeral"year using Roman numerals
    "YearExact"year including fraction
    "YearFraction"fractional part of year
    "Quarter"quarter number (e.g. 1)
    "QuarterName"quarter of year (e.g. "Quarter 1")
    "QuarterNameShort"quarter of year in short form (e.g. "Q1")
    "Month"month number (e.g. 8)
    "MonthName"month name (e.g. "August")
    "MonthNameShort"month name in short form (e.g. "Aug")
    "MonthExact"month including fraction
    "MonthFraction"fractional part of month
    "MonthNameInitial"first letter of month name (e.g. "A")
    "MonthRomanNumeral"month using Roman numerals
    "Week"week number (e.g. 12)
    "DayName"day of the week (e.g. Wednesday)
    "DayNameShort"day of the week in short form (e.g. "Wed")
    "DayNameInitial"first letter of day name (e.g. "W")
    "Day"day of the month (e.g. 9)
    "DayExact"day including fraction
    "DayFraction"fractional part of day
    "ISOWeekDay"day number of week conforming to ISO-8601 (e.g. 4)
    "ISOYearDay"day of the year conforming to ISO-8601 (e.g. 182)
    "ISOYearDayExact"year day including fraction
    "Hour"hour on 12- or 24-hour clock, based on system preferences
    "Hour12"hour on 12hour clock (e.g. 7)
    "Hour24"hour on 24hour clock (e.g. 19)
    "HourExact"hour including fraction
    "HourFraction"fractional part of hour
    "AMPM"AM or PM
    "AMPMLowerCase"am or pm
    "Minute"minute (e.g. 15)
    "MinuteExact"minute including fraction
    "MinuteFraction"fractional part of minute
    "Second"integer seconds
    "SecondExact"seconds including fractions
    "SecondFraction"fractional part of second
    "MillisecondFraction"fractional part of millisecond
    "CalendarType"calendar type (e.g. "Gregorian")
    "TimeZone"time zone as offset from GMT
    "Granularity"calendar granularity
  • Possible forms include:
  • Automaticnumbers, symbols, or strings, chosen automatically
    Integerclosest integer
    Realreal value
    Quantityvalue including units
    DateObjectcomplete date object
    TimeObjectcomplete time object
  • In DateValue[date,], date can be specified as a DateObject or TimeObject, or results from DateList, DateString, or AbsoluteTime.
  • DateValue[date,spec,DateObject] can be used to give a DateObject that is granular only down to the level (e.g. day, month, year) specified by spec.
  • DateValue[GeoPosition[{lat,long,h,t}]] gives a DateObject of the time specified by t.
  • DateValue accepts a list of DateObject or TimeObject date specifications.


open allclose all

Basic Examples  (1)

Get the current year:

Click for copyable input

Get multiple elements from the current date:

Click for copyable input

Get the month name from a given date:

Click for copyable input

Find the current "TimeZone" offset as a Quantity:

Click for copyable input

Scope  (3)

Possible Issues  (2)

See Also

DateString  DateList  DateBounds  DayName  DateObject  TimeObject  CurrentDate  NextDate  PreviousDate  DateWithinQ  DateOverlapsQ

Introduced in 2014