Penguin
Annotated edit history of date(1) version 4, including all changes. View license author blame.
Rev Author # Line
4 IanMcDonald 1 <verbatim>
1 perry 2 NAME
4 IanMcDonald 3 date - print or set the system date and time
4
1 perry 5 SYNOPSIS
4 IanMcDonald 6 date [OPTION]... [+FORMAT]
7 date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
8
1 perry 9 DESCRIPTION
4 IanMcDonald 10 Display the current time in the given FORMAT, or set the system date.
1 perry 11
4 IanMcDonald 12 -d, --date=STRING
13 display time described by STRING, not ‘now’
1 perry 14
4 IanMcDonald 15 -f, --file=DATEFILE
16 like --date once for each line of DATEFILE
1 perry 17
4 IanMcDonald 18 -r, --reference=FILE
19 display the last modification time of FILE
1 perry 20
4 IanMcDonald 21 -R, --rfc-2822
22 output date and time in RFC 2822 format
1 perry 23
4 IanMcDonald 24 --rfc-3339=TIMESPEC
25 output date and time in RFC 3339 format. TIMESPEC=‘date’, ‘sec‐
26 onds’, or ‘ns’ for date and time to the indicated precision.
1 perry 27
4 IanMcDonald 28 -s, --set=STRING
29 set time described by STRING
1 perry 30
4 IanMcDonald 31 -u, --utc, --universal
32 print or set Coordinated Universal Time
1 perry 33
4 IanMcDonald 34 --help display this help and exit
1 perry 35
4 IanMcDonald 36 --version
37 output version information and exit
1 perry 38
4 IanMcDonald 39 FORMAT controls the output. The only valid option for the second form
40 specifies Coordinated Universal Time. Interpreted sequences are:
1 perry 41
4 IanMcDonald 42 %% a literal %
1 perry 43
4 IanMcDonald 44 %a locale’s abbreviated weekday name (e.g., Sun)
1 perry 45
4 IanMcDonald 46 %A locale’s full weekday name (e.g., Sunday)
1 perry 47
4 IanMcDonald 48 %b locale’s abbreviated month name (e.g., Jan)
1 perry 49
4 IanMcDonald 50 %B locale’s full month name (e.g., January)
1 perry 51
4 IanMcDonald 52 %c locale’s date and time (e.g., Thu Mar 3 23:05:25 2005)
1 perry 53
4 IanMcDonald 54 %C century; like %Y, except omit last two digits (e.g., 21)
1 perry 55
4 IanMcDonald 56 %d day of month (e.g, 01)
1 perry 57
4 IanMcDonald 58 %D date; same as %m/%d/%y
1 perry 59
4 IanMcDonald 60 %e day of month, space padded; same as %_d
1 perry 61
4 IanMcDonald 62 %F full date; same as %Y-%m-%d
1 perry 63
4 IanMcDonald 64 %g last two digits of year of ISO week number (see %G)
1 perry 65
4 IanMcDonald 66 %G year of ISO week number (see %V); normally useful only with %V
1 perry 67
4 IanMcDonald 68 %h same as %b
1 perry 69
4 IanMcDonald 70 %H hour (00..23)
1 perry 71
4 IanMcDonald 72 %I hour (01..12)
1 perry 73
4 IanMcDonald 74 %j day of year (001..366)
1 perry 75
4 IanMcDonald 76 %k hour ( 0..23)
1 perry 77
4 IanMcDonald 78 %l hour ( 1..12)
1 perry 79
4 IanMcDonald 80 %m month (01..12)
1 perry 81
4 IanMcDonald 82 %M minute (00..59)
1 perry 83
4 IanMcDonald 84 %n a newline
1 perry 85
4 IanMcDonald 86 %N nanoseconds (000000000..999999999)
1 perry 87
4 IanMcDonald 88 %p locale’s equivalent of either AM or PM; blank if not known
1 perry 89
4 IanMcDonald 90 %P like %p, but lower case
1 perry 91
4 IanMcDonald 92 %r locale’s 12-hour clock time (e.g., 11:11:04 PM)
1 perry 93
4 IanMcDonald 94 %R 24-hour hour and minute; same as %H:%M
1 perry 95
4 IanMcDonald 96 %s seconds since 1970-01-01 00:00:00 UTC
1 perry 97
4 IanMcDonald 98 %S second (00..60)
1 perry 99
4 IanMcDonald 100 %t a tab
1 perry 101
4 IanMcDonald 102 %T time; same as %H:%M:%S
1 perry 103
4 IanMcDonald 104 %u day of week (1..7); 1 is Monday
1 perry 105
4 IanMcDonald 106 %U week number of year, with Sunday as first day of week (00..53)
1 perry 107
4 IanMcDonald 108 %V ISO week number, with Monday as first day of week (01..53)
1 perry 109
4 IanMcDonald 110 %w day of week (0..6); 0 is Sunday
1 perry 111
4 IanMcDonald 112 %W week number of year, with Monday as first day of week (00..53)
1 perry 113
4 IanMcDonald 114 %x locale’s date representation (e.g., 12/31/99)
1 perry 115
4 IanMcDonald 116 %X locale’s time representation (e.g., 23:13:48)
1 perry 117
4 IanMcDonald 118 %y last two digits of year (00..99)
1 perry 119
4 IanMcDonald 120 %Y year
1 perry 121
4 IanMcDonald 122 %z +hhmm numeric timezone (e.g., -0400)
1 perry 123
4 IanMcDonald 124 %:z +hh:mm numeric timezone (e.g., -04:00)
1 perry 125
4 IanMcDonald 126 %::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
1 perry 127
4 IanMcDonald 128 %:::z numeric time zone with : to necessary precision (e.g., -04,
129 +05:30)
1 perry 130
4 IanMcDonald 131 %Z alphabetic time zone abbreviation (e.g., EDT)
1 perry 132
4 IanMcDonald 133 By default, date pads numeric fields with zeroes. The following
134 optional flags may follow ‘%’:
1 perry 135
4 IanMcDonald 136 - (hyphen) do not pad the field _ (underscore) pad with spaces 0
137 (zero) pad with zeros ^ use upper case if possible # use oppo‐
138 site case if possible
1 perry 139
4 IanMcDonald 140 After any flags comes an optional field width, as a decimal number;
141 then an optional modifier, which is either E to use the locale’s alter‐
142 nate representations if available, or O to use the locale’s alternate
143 numeric symbols if available.
1 perry 144
4 IanMcDonald 145 AUTHOR
146 Written by David MacKenzie.
1 perry 147
4 IanMcDonald 148 REPORTING BUGS
149 Report bugs to <bug-coreutils@gnu.org>.
1 perry 150
4 IanMcDonald 151 COPYRIGHT
152 Copyright © 2006 Free Software Foundation, Inc.
153 This is free software. You may redistribute copies of it under the
154 terms of the GNU General Public License
155 <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
156 extent permitted by law.
1 perry 157
4 IanMcDonald 158 SEE ALSO
159 The full documentation for date is maintained as a Texinfo manual. If
160 the info and date programs are properly installed at your site, the
161 command
1 perry 162
4 IanMcDonald 163 info date
1 perry 164
4 IanMcDonald 165 should give you access to the complete manual.
3 GreigMcGill 166
4 IanMcDonald 167 </verbatim>
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.