Described at
The date utility shall write the date and time to standard output [XSI) ] ![[Option Start]]( or attempt to set the system date and time. ![[Option End]]( By default, the current date and time shall be written. If an operand beginning with '+' is specified, the output format of date shall be controlled by the conversion specifications and other text in the operand. When the format is specified, each conversion specifier shall be replaced in the standard output by its corresponding value. All other characters shall be copied to the output without change. The output shall always be terminated with a . See XBD LC TIME for the conversion specifier values in the POSIX locale. The name of the base year (period) in the locale's alternative representation. Week number of the year (Sunday as the first day of the week) using the locale's alternative numeric symbols. Week number of the year (Monday as the first day of the week, rules corresponding to %V ), using the locale's alternative numeric symbols. Week number of the year (Monday as the first day of the week) using the locale's alternative numeric symbols. [XSI) ] ![[Option Start]]( Attempt to set the system date and time from the value given in the operand. This is only possible if the user has appropriate privileges and the system permits the setting of the system date and time. The first mm is the month (number); dd is the day (number); hh is the hour (number, 24-hour system); the second mm is the minute (number); cc is the century and is the first two digits of the year (this is optional); yy is the last two digits of the year and is optional. If century is not specified, then values in the range [69,99] shall refer to years 1969 to 1999 inclusive, and values in the range [00,68] shall refer to years 2000 to 2068 inclusive. The current year is the default if yy is omitted. ![[Option End]]( Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. Determine the format and contents of date and time strings written by date . [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( Although certain of the conversion specifiers in the POSIX locale (such as the name of the month) are shown with initial capital letters, this need not be the case in other locales. Programs using these fields may need to adjust the capitalization if the output is going to be used at the beginning of a sentence. The date string formatting capabilities are intended for use in Gregorian-style calendars, possibly with a different starting year (or years). The %x and %c conversion specifications, however, are intended for local representation; these may be based on a different, non-Gregorian calendar. The E and O modifiers modify the traditional conversion specifiers, so that they can always be used, even if the implementation (or the current locale) does not support the modifier. The E modifier supports alternative date formats, such as the Japanese Emperor's Era, as long as these are based on the Gregorian calendar system. Extending the E modifiers to other date elements may provide an implementation-defined extension capable of supporting other calendar systems, especially in combination with the O modifier. The O modifier supports time and date formats using the locale's alternative numerical symbols, such as Kanji or Hindi digits or ordinal number representation. would yield 3.IX.1991. With the same d fmt , but without the alt digits , the command would yield 3.9.1991. 1. The following are input/output examples of date used at
Excerpt from a page describing this subject · 19,592 chars · not written by Vinony
Wikidata facts
- Image
- 2015-01-12 carrot-greeting-card.jpg
Show 3 more facts
- Commons category
- Date (UNIX)
- described at URL
- pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html
- has command line option
- u
Sources (2)
via Wikidata · CC0