CurrentDate

CurrentDate[gran]

gives the current date of the specified granularity type gran.

CurrentDate[date,gran]

gives the date of the given granularity that includes the specified date.

CurrentDate[]

gives the instant corresponding to the current date.

Details and Options

  • CurrentDate[gran] returns a DateObject expression.
  • In CurrentDate[gran], the granularity type gran can be any of the following:
  • "Millennium"1000-year period beginning with year XX00
    "MillenniumBeginning01"1000-year period beginning with year XX01
    "Century"100-year period beginning with year XX00
    "CenturyBeginning01"100-year period beginning with year XX01
    "Decade"10-year period including the date
    "Year"year including the date
    "Quarter"3-month quarter including the date
    "Month"month including the date
    "Week"week beginning Monday including the date
    "WeekBeginningSunday"week beginning Sunday including the date
    "Day"day including the date
    "Hour"hour including the date
    "Minute"minute including the date
    "Second"second including the date
    "Instant"the exact instant specified
  • For CurrentDate[daytype], the current day will be returned if it matches the specified daytype. Possible daytype specifications are: "Weekday", "WeekendDay", Monday through Sunday, "MonthFirstDay", "MonthLastDay" and "BusinessDay".
  • The following options can be given:
  • CalendarType Automaticcalendar system for the result
    TimeZone $TimeZonetime zone for the result

Examples

open allclose all

Basic Examples  (3)

Get a date object representing the current month:

Get the current hour:

Get the current instant:

Find the year associated with a given date:

Find the week of Albert Einstein's birth:

Verify that January 1, 2018 is a Monday:

If the given date does not match the specified day type, a message is issued:

Scope  (1)

Date specifications may be a DateObject, DateList or DateString:

Options  (2)

CalendarType  (1)

Get a granular date using the Jewish calendar:

TimeZone  (1)

Get a granular date with a specific time zone:

Properties & Relations  (2)

Today is equivalent to CurrentDate["Day"]:

Now is equivalent to CurrentDate[]:

Wolfram Research (2017), CurrentDate, Wolfram Language function, https://reference.wolfram.com/language/ref/CurrentDate.html (updated 2019).

Text

Wolfram Research (2017), CurrentDate, Wolfram Language function, https://reference.wolfram.com/language/ref/CurrentDate.html (updated 2019).

CMS

Wolfram Language. 2017. "CurrentDate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/CurrentDate.html.

APA

Wolfram Language. (2017). CurrentDate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CurrentDate.html

BibTeX

@misc{reference.wolfram_2023_currentdate, author="Wolfram Research", title="{CurrentDate}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/CurrentDate.html}", note=[Accessed: 28-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_currentdate, organization={Wolfram Research}, title={CurrentDate}, year={2019}, url={https://reference.wolfram.com/language/ref/CurrentDate.html}, note=[Accessed: 28-March-2024 ]}