Wikifunctions:Catalogue/Date operations
Appearance
Time operations
Date operations
Gregorian calendar dates
| date from day of year and year (Z24962) | Z20420K1: Gregorian year (Z20159) | year from calendar date (Z24948) |
|---|---|---|
| Z20420K2: Day of Roman year (Z20342) | day of year from calendar date (Z24936) | |
| — | K1 | Z24948 |
| K2.Z20342K1 | month from date (Z26504) | |
| K2.Z20342K2 | day of month from Gregorian calendar date (Z28143) | |
| — | K1 | Z24948 |
| K2 | day of the year (Z25768) | |
| full date of weekday occurrence in month of year (Z29903) | K1 | Z24948 |
| K1, K2 | month from date (Z26504) | |
| day of the week (Z20421) | ||
| — | ||
See suggested functions for more function ideas.
Operations on a date
- next day (Z20440): Returns the date of the next day in the Gregorian proleptic calendar.
- previous calendar day (Z24968): Returns the date of the previous day in the Gregorian proleptic calendar.
- move N days (Z20750): add (or subtract) an integer number of days to the starting Gregorian calendar date
- next day with weekday (Z20816): the next day after a date (or that date) with the given weekday.
Information about a date
- day of the week (Z20421): Given a date in the Gregorian proleptic calendar, what day of the week is that day?
- day of year from calendar date (Z24936): Given a Gregorian calendar date (e.g. 25 May 2025) return the day of the Roman year (i.e. 25 May)
- year from calendar date (Z24948): Description missing
- date from day of year and year (Z24962): Description missing
- day of month from Gregorian calendar date (Z28143): Description missing
- era from calendar date (Z25248): Returns the era (i.e. if it is AD or BC) from a Gregorian proleptic calendar date
- is event celebrated in this date? (Z24122): Given an event and a date, check whether the event is celebrated in the given date
- is Catholic Easter (Z25266): Checks whether a date is Catholic Easter.
- Is date palindrome (Z20740): in the YYYY-MM-DD or the YY-MM-DD format, without the -
- days until Feinmas '24 (Z20822): Description missing
- Distance between the Earth and the Moon on date (Z20741): Returns the distance between the Earth and the Moon, on the provided date. Answer is in Kilometers.
- is proleptic? (Z25280): Returns true if the date is expressed in proleptic Gregorian calendar, i.e. if it is before 15 October 1582
- Week Number (ISO) (Z26059): Retrieve the ISO-8601 week number from a given date
Information between two dates
- Same Gregorian calendar date (Z20430): Description missing
- date before (Z25271): false if equal
- later date (Z25276): Description missing
- age (Z20756): returns the difference between two dates on the Gregorian calendar in years
- years between (Z24918): How many years between two dates?
- months between (Z27190): Description missing
- time between two dates with unit, chosen language (Z27198): Description missing
- days until (Z20744): distance between two days (exclusive of the latter), as an integer
- days until next Meyboom (Z31188): Calculate days remaining until next Meyboom (a tradition from Brussels)
- percent of date range completed (Z20856): Returns the percent (as a rational number) of days completed for a given date and date range.
Conversions
- Gregorian calendar date from Wikidata datetime (Z25603): returns the date part of a datetime item
- time of day from Wikidata datetime (Z25711): returns the Time of day component of the supplied Wikidata datetime
- Gregorian Date to Julian Day Number (Z22844): converts a Gregorian calendar date to the corresponding Julian day number
- Unix timestamp from Gregorian calendar date (Z23801): returns provided date as number of seconds since the Unix epoch (1 January 1970); for inverse see Z23808
- Gregorian calendar date from Unix timestamp (Z23808): returns Gregorian calendar date from supplied seconds since the Unix epoch (1 January 1970); for inverse see Z23801
- Arvelie date from Gregorian date (Z23246): year zero defines when journaling begins (e.g. starting timekeeping on 2024-11-30 makes 2024 year zero) (see https://wiki.xxiivv.com/site/arvelie.html)
- Gregorian calendar date identity (Z24884): Echoes the Gregorian calendar date in input. Useful as a date formatter for Wikitext
- Gregorian date and time from (rational) JD (Z27478): JD is a continuous count of days and fractions since noon Universal Time on January 1, 4713 BC (on the Julian calendar). Gregorian date is proleptic. This function is the inverse of Z27604.
- Julian calendar in Gregorian calendar (Z28119): Description missing
- Gregorian to Hijri date conversion function (Z28911): Convert the date from the Gregorian date to the Hijri date approximately, with an error rate of up to one day sometimes. The date is according to Mecca time (Saudi Arabia).
- Converting Hijri Date to Gregorian Date function (Z28600): Transforming the Hijri date to the Gregorian in an approximate manner, and sometimes an error rate reaches one day. History according to the timing of Mecca (Saudi Arabia)
Dates to strings
- display date (Z20780): displays a date in the given language.
- date (multilingual) (Z20788): a date following ISO 6801 YYYY-MM-DD format
- date DMY (ar) (Z22214): Date in DMY format, Arabic months
- date (dagwiki) (Z20770): Represents a Gregorian Calendar Date on the Dagbani Wikipedia
- display Gregorian date in Dagbani (Z24880): returns a string spelling out the date in Dagbani
- date (dewiki) (Z20776): Represents a date on dewiki
- date (enwiki) (Z20773): A date in the dmy format
- date (enwiki, mdy) (Z20782): Displays a date in the mdy format in english
- date (eswiki) (Z20794): date on the Spanish Wikipedia
- French date (Z20785): a date in French in dmy
- date (huwiki) (Z20791): a date on the Hungarian Wikipedia
- date (itwiki) (Z23197): display date in the dmy format in Italian
- Luxembourgish date from Gregorian calendar date (Z27655): transforms Gregorian calendar date to date in Luxembourgish
- date (ruwiki) (Z20801): A date on the Russian Wikipedia
Strings to dates
- read Gregorian Calendar Date (Z20808): Parse a Gregorian Calendar Date leniently, but ideally appropriately to the conventions of the selected language.
- read Gregorian date, multiple languages (Z23976): Description missing
- read date in standard format (Z24007): Description missing
- read Gregorian Date, en (dmy) (Z23984): Leniently reads a Gregorian Date, preferring the dmy format.
- read Gregorian Date, en, dag (mdy) (Z23990): Leniently reads a Gregorian Date, preferring the mdy format. It also supports the Dagbani Gregorian calendar format
- parse Gregorian Date in Italian (Z23961): Tries to parse the Gregorian Date in Italian in the most lenient way possible
Day of Roman year
| Day of Roman year from components (Z20591) | Z20342K1: Gregorian calendar month (Z16098) | month from day of the Roman year (Z20343) |
|---|---|---|
| Z20342K2: Natural number (Z13518) | day of month from date (Z20388) | |
| — | K1, K2 | Day of Roman Year to Day number in year (Z20357) |
- day of month from date (Z20388): returns the day of the month in day of Roman year
- month from day of the Roman year (Z20343): Given a day of the Roman year, it returns the month
- day of year from calendar date (Z24936): Given a Gregorian calendar date (e.g. 25 May 2025) return the day of the Roman year (i.e. 25 May)
- next day in a standard year (Z20355): Returns the next day in the year. Not a leap year. 1 January follows 31 December.
- next day in leap year (Z20399): Description missing
- Day of Roman Year to Day number in year (Z20357): Utility function
- Day number in year to Day of Roman Year (Z20362): Description missing
- Move N dates (Z20367): returns the day of a Roman year shifted by an integer N number of days. May not be correct if it goes outside the year of origin.
- earlier in year (Z20406): is the first calendar day earlier in the year compared to the second calendar day (false if equal)
- Day of Roman year from components (Z20591): combines the month and the day number to make a Day of Roman year type
- date as English "Month day" string (Z22933): Description missing
- date as English "day Month" string (Z24974): Day of Roman year as English "day Month" string
- day of celebration of an annual recurrence (Z23427): Given a Wikimedia item reference representing an annual celebration, the year, and the place, returns the day of the year when it occurs
- month of Day of Roman year unknown (Z26166): true if the month in the Day of Roman year object is set to void (unknown)
- Day of Roman Year fully defined (Z26237): returns true if both day and month are defined
- kleenean compare days of Roman year (Z26271): Returns true if two days are certainly the same, maybe if they could be the same and false if it's impossible that the two days are the same
Using non-date types
- is leap year (natural number Gregorian calendar) (Z10996): Natural number version of Z20181. Returns True if the specified year in the Gregorian calendar has 366 days (February 29th added), and False if the year has 365 days
- is leap year (Julian calendar) (Z11015): Returns True if the specified year in the Julian calendar has 366 days, and False if the year has 365 days
- is leap year (Jalali calendar) (Z11011): Returns True if the specified year in the Jalali calendar (one of the calendars still in use in Iran and Afghanistan, also called Persian calendar) has 366 days, and False if the year has 365 days
- is leap year (Nanakshahi calendar) (Z12176): returns true if the given year is a leap year in the Nanakshahi Punjabi calendar, and false otherwise
- Get day of week from date (Z13163): returns the day of week when given a date as year, month, and day of month
- get weekday number (starting Sunday=1) from date (Z16914): returns the weekday number as a natural number when given a date as year, month and day of the month
- advance n days to get a later date (D/M/YYYY) (Z13306): when given date and number of day(s) to advance, it advances on top of the date been given to get a later date.
- go back n days to get a previous date (D/M/YYYY) (Z16908): when given date and number of day(s), it goes back from the date to get a previous date
- gregorian to nengō (Z13300): converts a given gregorian year to japanese year format, in case of pivotal year, returns both results
- nengō to gregorian (Z13335): converts a given japanese year into gregorian year
- date difference (English strings) (Z18957): Takes start and end dates and returns the difference between them.
- date difference in days (string input) (Z18961): Takes start and end dates and returns the difference between them in days.
- country-wide daylight savings start date in year (Z29899): Won't work for countries without DST. Could return an error.
Bengali date operations
- Gregorian to Bengali date (Bangladesh) (Z12926): Converts a Gregorian date to Bangla date per Bangladeshi calendar. Inputs: Year, Month, Day.
- Bengali to Gregorian date (Bangladesh) (Z18131): Converts a Bengali date to Gregorian per Bangladeshi calendar. Inputs: Year, Month, Day.
- Gregorian to Bengali date (India) (Z18435): Converts a Gregorian date to Bangla date per Indian calendar. Inputs: Year, Month, Day.
- Bengali to Gregorian date (India) (Z18462): Converts a Bengali date to Gregorian per Indian calendar. Inputs: Year, Month, Day.
- Days in Bengali month (Bangladesh) (Z18169): Returns the number of days in a Bengali month according to the Bangladeshi calendar.
- Days in Bengali month (India) (Z18573): Returns the number of days in a Bengali month according to the Indian calendar.
- Is same Bengali month days (Z18582): It checks whether a Bengali month has the same number of days according to both the Indian and Bangladeshi calendar versions.
- Month number to Bengali month (Z18387): Returns the Bengali romanized month name for a number. Allows overcounting.
- Bengali to Gregorian months (Z18397): Returns the Gregorian month numbers corresponding to a Bengali month number.
- Months in period (Bengali) (Z18662): Takes the start and end month numbers and return the list of Bengali months between them
Year operations
Gregorian year
| Gregorian year from components (Z20588) | Z20159K1: Gregorian era (Z17813) | Gregorian era of Gregorian year (Z20185) |
|---|---|---|
| Z20159K2: Natural number (Z13518) | Gregorian year to year number (Z20160) | |
| — | K1, K2 | Gregorian year to ISO 8601 year integer (Z20257) |
Information about a year
- next year (Z20172): Description missing
- previous year (Z20314): Description missing
- Gregorian era of Gregorian year (Z20185): Description missing
- Gregorian year to year number (Z20160): Returns the absolute year number, i.e. 2024 AD is 2024, 500 BC is 500.
- is Gregorian year leap year? (Z20181): returns True if the specified year in the Gregorian calendar (the one currently used in most parts of the world) has 366 days (February 29th added), and False if the year has 365 days
- Gregorian year to ISO 8601 year integer (Z20257): Per ISO 8601, 1 BC is turned into 0, 2 BC into -1, etc.
- Gregorian year to ISO 8601 year string (Z22920): Always returns at least 4 digits, per ISO 8601. Use expanded form to represent negatives or more than 4 digits.
- starts on (Z20290): What day of the week does the given year start on, i.e. what day of the week is the first of January of the given year?
- day of the week this year ends with (Z20302): the day of the week of the last day of the year
- Is year (recorded) El Nino year (Z20277): Is the year an El Nino year after 1900?
- date of Gregorian Easter (Z23254): Calculate the day of the Catholic Easter, given the year
- date of Julian Easter (Z23269): Returns the date of Eastern Orthodox Easter (Julian Easter) as a Gregorian day
- Generate year number of sequence string (Z20610): E.g. the 2023rd year of the Common Era (CE) and Anno Domini (AD) designations, the 23rd year of the 3rd millennium and the 21st century, and the 4th year of the 2020s decade
- Numbers of days in a month (Z20648): Returns the number of days in a month.
- date of weekday occurrence in month of year (Z20730): calculates the date of a particular occurrence of a day of the week within a month of a particular year
- day of the week within a given month from Wikidata (Z23423): Given a Wikidata item reference to an instance of day of the week within a given month (Q51118183) and a year, returns the corresponding Roman calendar date
- day of celebration of an annual recurrence (Z23427): Given a Wikimedia item reference representing an annual celebration, the year, and the place, returns the day of the year when it occurs
- Wikidata item for celebration day (Z23455): Returns the best Wikidata item to calculate Z23427
- value of Wikidata claim to day of the year (Z23474): Given the value of a Wikidata claim representing a specific day of the year, and given the year, returns the corresponding day of the Gregorian calendar
- Year to century in English (Z24222): Returns the century a given year is in
- Year to century in Spanish (Z24229): Returns the century of the given year in Spanish
- Year to millennium in English (Z24244): Returns the millennium a given year is in
- is year BC (Z28855): Returns true if the given year is in the BC / BCE era, otherwise false.
- is year AD (Z28875): Checks if a year is AD / CE and returns true if so
Comparing two years
| y1 ≠ y2 Q110013332 |
— | y1 ⟺ y2 Q7797295 |
Sign of difference of Gregorian years (Z35792) | |
|---|---|---|---|---|
| y1 < y2 Q52834024 |
is first year before second (Z28833) | y1 > y2 Q47035128 |
— | |
| y1 ≤ y2 Q55935272 |
— | y1 ≥ y2 Q55935291 |
— | |
| y1 = y2 Q842346 |
same Gregorian year (Z20166) | y1 ≈ y2 Q26161438 |
— | |
| y ≤ 1 BCE | is year BC (Z28855) | y ≥ 1 CE | is year AD (Z28875) | |
- same Gregorian year (Z20166): Description missing
- difference between Gregorian years (Z20219): Finds the number of years between the two years entered. Returns an integer in case the "earlier year" is after the "later year" (in which case the answer is negative).
- is first year before second (Z28833): Tells us if the first year is before the second
- year is before (using integers) (Z25568): Returns a boolean of whether Year 1 is before Year 2.
- year is after (Z25575): Returns a boolean of whether Year 1 is after Year 2.
Conversions
- display Gregorian year (Z20241): display function to take a Gregorian year and a language, and return a string representation for that language
- Display Gregorian year in Italian (Z23193): Display Gregorian year in Italian language (e.g. 1808 d.C.)
- read Gregorian year (Z22910): reader function to take a string with an associated language, and return a Gregorian year
- String as Gregorian Year (Z20198): Description missing
- Gregorian year as string (English) (Z20192): Description missing
- year from calendar date (Z24948): Description missing
- Day from Date + Year (Z20371): Description missing
- Gregorian year from components (Z20588): returns a Gregorian year given the era and year number
- Gregorian era of Gregorian year (Z20185): Description missing
- Gregorian year to year number (Z20160): Returns the absolute year number, i.e. 2024 AD is 2024, 500 BC is 500.
- Gregorian year to ISO 8601 year integer (Z20257): Per ISO 8601, 1 BC is turned into 0, 2 BC into -1, etc.
- Gregorian year to ISO 8601 year string (Z22920): Always returns at least 4 digits, per ISO 8601. Use expanded form to represent negatives or more than 4 digits.
- birth year from Singapore NRIC number (Z22030): Description missing
- Arvelie date from Gregorian date (Z23246): year zero defines when journaling begins (e.g. starting timekeeping on 2024-11-30 makes 2024 year zero) (see https://wiki.xxiivv.com/site/arvelie.html)
- year from item and property (Z28777): Returns the Gregorian year of the time that is the best property value for a given item
Intro for year
- Intro for year (Z20898): an introduction for a year in a language. BC years are not supported.
- intro for year (dagwiki) (Z20767): Introduction for a year on the Dagbani Wikipedia
- Intro for year in German (Z20727): Creates a possible short introduction text for a year.
- intro for year in English (Z20597): creates the intro sentences for articles about years, similar to the English Wikipedia's style
- Intro for year in Turkish (Z21590): Provides details for a given year.
Day of the week
- same day of the week (Z17414): True if the two given days of the week are the same
- day of the week (Z20421): Given a date in the Gregorian proleptic calendar, what day of the week is that day?
- next day of the week (Z17420): returns the next day after the input day.
- previous day of the week (Z17435): returns the day before the input day
- advance N days of the week (Z17517): returns the day of the week N after the input day (N can be negative)
- day number to day (starting 1=Sunday) (Z17478): returns the name of a weekday, given by its number in the week, starting at SUNDAY with number 1
- day to day number (starting Sunday=1) (Z17485): Description missing
- total occurrences of day in month (Z17452): When given a day, Gregorian month and year it returns total number of times the given day occurs in that month of that year.
- total occurrences of day in year (Z17536): When given a day and year it returns total number of times the given day occurs in that year.
- first date of a given day in a month (Z17506): return the date of the first day in a specific month and year
- last date of a given day in a month (Z17511): return the date of the last day in a specific month and year
- starts on (Z20290): What day of the week does the given year start on, i.e. what day of the week is the first of January of the given year?
- day of the week this year ends with (Z20302): the day of the week of the last day of the year
- get day of the week from numerical date (Z17540): Description missing
- Date list for a specific day in a given month and year (Z17516): return list of all dates (d/m/y strings) of given day in a specific month and year
- get nth date of a given day in month as string (Z17549): When given a day, month, year, and a valid occurrence index, it returns the date corresponding to that specific occurrence of the given day within the same month as a string otherwise return nothing.
- is date on day (Z17556): return true if the given date fall on the given day otherwise false.
- days from one day to another (Z17578): count of how many days from the first day to the second (0 if the same)
- Wikidata reference to day of the week (Z23415): Given a Wikidata item reference representing the day of the week return said day of the week
- day of the week to Wikidata reference (Z23419): returns the Wikidata item reference representing the day of the week
Month operations
Gregorian months
- same month (Z16137): Checks whether 2 instances of "Gregorian calendar month" are the same
- following month (Z16136): Returns the month that follows a given month
- previous month (Z16299): returns the month before the input month
- month number to month (Z16255): Converts the natural number (1-12) it corresponds to in the order of months in a year to the month object. Tolerant of overcounting, so 13 = January, etc. 0 return Void.
- month to month number (Z16230): converts a month to the natural number (1-12) it corresponds to in the order of months in a year
- months in period (list) (Z16330): returns a list of the (Gregorian) months beginning with the first month given and ending with the final month
- month from date (Z26504): returns the Gregorian calendar month from a Gregorian calendar date
- month label (Z16580): returns the string value of the Persistent object label for the given Gregorian calendar month and Natural language (if one exists)
- twelve months (Z16272): returns a list of the twelve (Gregorian) months
- month is in list (Z16289): returns True if a given month is in a given list of months: doesn't support void
- opposite month (Z16584): returns the month six months away from the input month
- is later month in the year (Z16648): true if the first month occurs strictly later in the same calendar year than the second
- is this month earlier than that month in the year? (Z16542): true if the first month occurs strictly earlier in the calendar year than the second
- days in month when not a leap year (Z16316): returns the number of days in the requested month, for non leap years
- days in month during leap year (Z16332): returns the number of days in the requested month, for leap years
- days in list of months (non-leap year) (Z16348): returns the total number of days in a list of months
- N months after month (Z16307): returns the month that is the given number of months after the given month
- N months before month (Z16293): returns the month a given number before a given month
- English name of month (Z13596): transforms Gregorian month to the English name of the month
- Gregorian calendar month to Wikidata reference (Z22240): Description missing: Don't know what to do with void
- Wikidata item reference to Gregorian month (Z23403): Takes in input a Wikidata item reference that points to a month and returns said month as an object of type Gregorian month: Same
- kleenean compare months (Z26280): Description missing
Igbo months
- Igbo month name in Igbo (Z16000): transforms an Igbo month to its name in Igbo
- same Igbo month (Z16945): when given two Igbo calendar month identities, it returns true if they are identical otherwise false.
- month number to Igbo month (Z16955): Converts the natural number (1-13) it corresponds to in the order of Igbo months in a year to the month object. Tolerant of overcounting, so 0 = Ụzọ Alụsị, 14 = Mbụ and above 14 results to an error.
- following month (Igbo) (Z16972): Returns the month that follows a given Igbo month
- Igbo month to month number (Z16973): converts a month to the natural number (1-13) it corresponds to in the order of Igbo months in a year
- previous month (Igbo) (Z16990): returns the month before a given Igbo month
- days in month (Igbo) (Z17685): Returns the days in an Igbo calender month.
Era operations
Gregorian era
- same Gregorian era (Z17817): Checks whether 2 Gregorian eras are the same
- opposite era (Z17977): returns AD if the input is BC and vice versa
- Gregorian era to sign (Z18072): Description missing
- sign to Gregorian era (Z18080): Description missing
- Gregorian era is AD (Z18084): Description missing
- Gregorian era is BC (Z25060): returns true if the specified era is BC/E, otherwise false