Difference between revisions of "Command/currentdate"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \currentdate")
 
(Added two examples for incrementing and decrementing \currentdate, wondering why the code only works for year and day but not for month...)
Line 88: Line 88:
  
 
</cd:description>
 
</cd:description>
<cd:examples><cd:example title="">
+
<cd:examples><cd:example title="Example 1: The Current Date"><context source="yes" text="gives">
<context source="yes" text="gives">
 
 
\currentdate[weekday,month,day,{, },year]
 
\currentdate[weekday,month,day,{, },year]
  
 
\currentdate[day,{.~},month,{~},year]
 
\currentdate[day,{.~},month,{~},year]
 +
</context></cd:example><cd:example title="Example 2: Incrementing and Decrementing the Current Date"><context source="yes" text="gives">
 +
Today it's \currentdate.\blank
 +
 +
\increment\normalday
 +
 +
Tomorrow will be \currentdate.\blank
 +
 +
\decrement\normalday
 +
%\increment\normalmonth% -- gives and error
 +
\increment\normalyear
 +
 +
And today in a year will be \currentdate.
 +
</context></cd:example><cd:example title="Example 3: Incrementing/Decrementing the Date Locally"><context source="yes" text="gives">
 +
Today it's \currentdate.\blank
 +
 +
\start\increment\normalday
 +
Tomorrow will be \currentdate.\blank
 +
\stop
 +
 +
Yet today it's still \currentdate.
 
</context></cd:example></cd:examples>
 
</context></cd:example></cd:examples>
 
<cd:notes></cd:notes>
 
<cd:notes></cd:notes>

Revision as of 18:36, 21 August 2023


\currentdate

Summary

The command \currentdate typesets the current date.

Settings

\currentdate[...,...]
[...,...]year year:name y y:name yy Y Y:name YY month month:mnem month:hebrew month:jalali m m:mnem m:hebrew m:jalali MONTH MONTH:mnem MONTH:hebrew MONTH:jalali mm M day day:name day:+ day:ord day:++ day:highord d d:name d:+ d:ord d:++ d:highord dd dd:+ dd:ord dd:++ dd:highord D D:+ D:ord D:++ D:highord weekday weekday:mnem weekday:hebrew weekday:jalali w w:mnem w:hebrew w:jalali WEEKDAY WEEKDAY:mnem WEEKDAY:hebrew WEEKDAY:jalali W referral space \\\\\\\\␣ text hebrew:to jalali:to jalali:from

OptionExplanation
This format is a comma-separated list of field formats and optional separators.

Settings name

\currentdate[...]
[...]name

OptionExplanation
This is a date format defined with \definedate

Description

The command \currentdate typesets the current date using a supplied format.



Examples

Example 1: The Current Date

\currentdate[weekday,month,day,{, },year]

\currentdate[day,{.~},month,{~},year]

gives

Example 2: Incrementing and Decrementing the Current Date

Today it's \currentdate.\blank

\increment\normalday

Tomorrow will be \currentdate.\blank

\decrement\normalday
%\increment\normalmonth% -- gives and error
\increment\normalyear

And today in a year will be \currentdate.

gives

Example 3: Incrementing/Decrementing the Date Locally

Today it's \currentdate.\blank

\start\increment\normalday
Tomorrow will be \currentdate.\blank
\stop

Yet today it's still \currentdate.

gives

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: