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. OPTIONS The date utility shall conform to the Base Definitions volume of IEEE Std 1003. Otherwise, date shall use the timezone indicated by the TZ environment variable or the system default if that variable is unset or null. OPERANDS The following operands shall be supported: + format 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. Conversion Specifications %a Locale's abbreviated weekday name. All days in a new year preceding the first Sunday shall be considered to be in week 0. If the week containing January 1 has four or more days in the new year, then it shall be considered week 1; otherwise, it shall be the last week of the previous year, and the next week shall be week 1. All days in a new year preceding the first Monday shall be considered to be in week 0. See the Base Definitions volume of IEEE Std 1003. 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. The current year is the default if yy is omitted. Note: It is expected that in a future version of IEEE Std 1003. This would apply to all commands accepting a 2-digit year as input. ENVIRONMENT VARIABLES The following environment variables shall affect the execution of date: LANG Provide a default value for the internationalization variables that are unset or null. See the Base Definitions volume of IEEE Std 1003. TZ Determine the timezone in which the time and date are written, unless the -u option is specified. If the TZ variable is unset or null and -u is not specified, an unspecified system default timezone is used. EXIT STATUS The following exit values shall be returned: 0 The date was written successfully. CONSEQUENCES OF ERRORS Default. The following sections are informative. APPLICATION USAGE Conversion specifiers are of unspecified format when not in the POSIX locale. Some of them can contain s in some locales, so it may be difficult to use the format shown in standard output for parsing the output of date in those locales. The range of values for %S extends from 0 to 60 seconds to accommodate the occasional leap second. 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 %C conversion specification was introduced to allow a fallback for the %EC alternative year format base year ; it can be viewed as the base of the current subdivision in the Gregorian calendar. Both the %Ey and %y can then be viewed as the offset from %EC and %C, respectively. 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. Non-European locales, whether they use Latin digits in computational items or not, often have local forms of the digits for use in date formats. This is not totally unknown even in Europe; a variant of dates uses Roman numerals for the months: the third day of September 1991 would be written as 3. In Japan, Kanji digits are regularly used for dates; in Arabic-speaking countries, Hindi digits are used. The %d, %e, %H, %I, %m, %S, %U, %w, %W, and %y conversion specifications always return the date and time field in Latin digits that is, 0 to 9. The %O modifier was introduced to support the use for display purposes of non-Latin digits. The -u option was introduced to allow portable access to Coordinated Universal Time UTC. The %e format conversion specification adopted from System V was added because the ISO C standard conversion specifications did not provide any way to produce the historical default date output during the first nine days of any month. These are represented by %w and %U. A variant of this is %W, using Monday as the first day of the week, but still referring to week 0. This view of the calendar was retained because so many historical applications depend on it and the ISO C standard function, on which many date implementations are based, was defined in this way. These are represented by the new conversion specifications %u and %V, added as a result of international comments. SEE ALSO The System Interfaces volume of IEEE Std 1003. Issue 5 Changes are made for Year 2000 alignment. A clarification is made such that the current year is the default if the yy argument is omitted when setting the system date and time.