{{extract|2004-04-03|add=5.75d}} → 18:00 8 ਅਪ੍ਰੈਲ 2004 (years and months are integer only)
Fix
By default, the date entered must be valid. If fix=on is used, units which are too large are "fixed". For example, 26 hours would be regarded as 1 day and 2 hours.
Entering a day as zero is regarded as the previous day (the last day of the previous month). The day before the previous day would be indicated with -1.
Similarly, entering a month as zero goes back one month, and entering -1 goes back two months.
Examples:
{{extract|2001|5|31|fix=on}} → 31 ਮਈ 2001 (no fix is required)
{{extract|2001|5|0|fix=on}} → 30 ਅਪ੍ਰੈਲ 2001
{{extract|2001|5|-1|fix=on}} → 29 ਅਪ੍ਰੈਲ 2001
{{extract|2001|125|-1000|fix=on}} → 3 ਅਗਸਤ 2008
{{extract|2001|0|12|fix=on}} → 12 ਦਸੰਬਰ 2000
{{extract|2016|3|0|fix=on}} → 29 ਫਰਵਰੀ 2016
The following shows how to get the date for a given year and day-of-year. For example, June 30, 2001 is day 181 in the year 2001, as can be seen by adding 181 days to the date just before January 1, 2001.
{{extract|June 30, 2001|show=dayofyear}} → 181 (date to day-of-year)
{{extract|2001|1|0|fix=on|add=181d|show=mdy}} → ਜੂਨ 30, 2001 (day-of-year to date)
Partial
If partial=on is used, the date may consist of a year only, or a year and month only. Addition is not supported for a partial date.
{{extract|2001|5|partial=on}} → ਮਈ 2001
{{extract|2016|partial=on|show=isleapyear}} → 1
Show
The following table lists most of the show parameters that can be used. Some of these work properly only with a full date.
Parameter
Description
show=hide
display nothing; may be useful with sortable=on
show=year
year
show=month
month (1 to 12)
show=day
day of month (1 to 31)
show=hour
hour (0 to 23)
show=minute
minute (0 to 59)
show=second
second (0 to 59)
show=dayabbr
abbreviated name of day of week
show=dayname
full name of day of week
show=dayofweek
day-of-week (0=Sunday to 6=Saturday)
show=dayofweekiso
day-of-week (1=Monday to 7=Sunday)
show=dayofyear
day-of-year (1 to 366)
show=era
an era code such as BC or BCE
show=format
code for the detected format of the input date (dmy, mdy, ymd, or error)
show=gsd
Gregorian serial date
show=juliandate
Julian day
show=isleapyear
1 if the date is in a leap year; 0 otherwise
show=monthabbr
abbreviated name of month
show=monthdays
number of days in the month of the date
show=monthname
full name of month
show=dmy
show date as "day month year" (default)
show=mdy
show date as "month day, year"
show=ymd
show date as "year-month-day"
Examples:
{{extract|1 Feb 2001}} → 1 ਫਰਵਰੀ 2001
{{extract|FEB 1 2001}} → 1 ਫਰਵਰੀ 2001
{{extract|2001-2-1}} → 1 ਫਰਵਰੀ 2001
{{extract|1 Feb 2001|show=format}} → dmy
{{extract|FEB 1 2001|show=format}} → mdy
{{extract|2001-2-1|show=format}} → ymd
{{extract|2001-2-29|show=format}} → error
{{extract|1 Feb 2001|show=mdy}} → ਫਰਵਰੀ 1, 2001
{{extract|1 Feb 2001|show=ymd}} → 2001-02-01
{{extract|June 30, 2001|show=dayname}} → Saturday
{{extract|June 30, 2001|show=dayofyear}} → 181
{{extract|2001-2-1|show=monthname}} → ਫਰਵਰੀ
{{extract|2001-2-1|show=a %{dayname} in %{monthname} }} → a Thursday in ਫਰਵਰੀ
Some show options will not produce a useful result with a partial date, for example:
Insert a sort key using table syntax data-sort-value="value"|.
sortable=debug
Same as sortable=on but the sort key is displayed for testing.
The sort key is calculated from the juliandate value. For a partial date such as May 2016, the first day in the range is used (1 May 2016).
If wanted, show=hide can be used so the date is not displayed.
The prefix parameter allows the insertion of text that will not interfere with sorting. For example, {{extract|500 BC|prefix=c.|partial=on|sortable=on}} outputs a hidden sort key followed by "c. 500 BC".