⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getdate.texi

📁 Linux下文件工具。
💻 TEXI
📖 第 1 页 / 共 2 页
字号:
@cindex time of day itemA @dfn{time of day item} in date strings specifies the time on a givenday.  Here are some examples, all of which represent the same time:@example20:02:020:028:02pm20:02-0500      # In @sc{est} (U.S. Eastern Standard Time).@end exampleMore generally, the time of the day may be given as@samp{@var{hour}:@var{minute}:@var{second}}, where @var{hour} isa number between 0 and 23, @var{minute} is a number between 0 and59, and @var{second} is a number between 0 and 59.  Alternatively,@samp{:@var{second}} can be omitted, in which case it is taken tobe zero.@findex am @r{in date strings}@findex pm @r{in date strings}@findex midnight @r{in date strings}@findex noon @r{in date strings}If the time is followed by @samp{am} or @samp{pm} (or @samp{a.m.}or @samp{p.m.}), @var{hour} is restricted to run from 1 to 12, and@samp{:@var{minute}} may be omitted (taken to be zero).  @samp{am}indicates the first half of the day, @samp{pm} indicates the secondhalf of the day.  In this notation, 12 is the predecessor of 1:midnight is @samp{12am} while noon is @samp{12pm}.(This is the zero-oriented interpretation of @samp{12am} and @samp{12pm},as opposed to the old tradition derived from Latinwhich uses @samp{12m} for noon and @samp{12pm} for midnight.)@cindex time zone correction@cindex minutes, time zone correction byThe time may alternatively be followed by a time zone correction,expressed as @samp{@var{s}@var{hh}@var{mm}}, where @var{s} is @samp{+}or @samp{-}, @var{hh} is a number of zone hours and @var{mm} is a numberof zone minutes.  When a time zone correction is given this way, itforces interpretation of the time relative toCoordinated Universal Time (@sc{utc}), overriding any previousspecification for the time zone or the local time zone.  The @var{minute}part of the time of the day may not be elided when a time zone correctionis used.  This is the best way to specify a time zone correction byfractional parts of an hour.Either @samp{am}/@samp{pm} or a time zone correction may be specified,but not both.@node Time zone items@section Time zone items@cindex time zone itemA @dfn{time zone item} specifies an international time zone, indicatedby a small set of letters, e.g., @samp{UTC} or @samp{Z}for Coordinated UniversalTime.  Any included periods are ignored.  By following anon-daylight-saving time zone by the string @samp{DST} in a separateword (that is, separated by some white space), the correspondingdaylight saving time zone may be specified.Time zone items other than @samp{UTC} and @samp{Z}are obsolescent and are not recommended, because theyare ambiguous; for example, @samp{EST} has a different meaning inAustralia than in the United States.  Instead, it's better to useunambiguous numeric time zone corrections like @samp{-0500}, asdescribed in the previous section.@node Day of week items@section Day of week items@cindex day of week itemThe explicit mention of a day of the week will forward the date(only if necessary) to reach that day of the week in the future.Days of the week may be spelled out in full: @samp{Sunday},@samp{Monday}, @samp{Tuesday}, @samp{Wednesday}, @samp{Thursday},@samp{Friday} or @samp{Saturday}.  Days may be abbreviated to theirfirst three letters, optionally followed by a period.  The specialabbreviations @samp{Tues} for @samp{Tuesday}, @samp{Wednes} for@samp{Wednesday} and @samp{Thur} or @samp{Thurs} for @samp{Thursday} arealso allowed.@findex next @var{day}@findex last @var{day}A number may precede a day of the week item to move forwardsupplementary weeks.  It is best used in expression like @samp{thirdmonday}.  In this context, @samp{last @var{day}} or @samp{next@var{day}} is also acceptable; they move one week before or afterthe day that @var{day} by itself would represent.A comma following a day of the week item is ignored.@node Relative items in date strings@section Relative items in date strings@cindex relative items in date strings@cindex displacement of dates@dfn{Relative items} adjust a date (or the current date if none) forwardor backward.  The effects of relative items accumulate.  Here are someexamples:@example1 year1 year ago3 years2 days@end example@findex year @r{in date strings}@findex month @r{in date strings}@findex fortnight @r{in date strings}@findex week @r{in date strings}@findex day @r{in date strings}@findex hour @r{in date strings}@findex minute @r{in date strings}The unit of time displacement may be selected by the string @samp{year}or @samp{month} for moving by whole years or months.  These are fuzzyunits, as years and months are not all of equal duration.  More preciseunits are @samp{fortnight} which is worth 14 days, @samp{week} worth 7days, @samp{day} worth 24 hours, @samp{hour} worth 60 minutes,@samp{minute} or @samp{min} worth 60 seconds, and @samp{second} or@samp{sec} worth one second.  An @samp{s} suffix on these units isaccepted and ignored.@findex ago @r{in date strings}The unit of time may be preceded by a multiplier, given as an optionallysigned number.  Unsigned numbers are taken as positively signed.  Nonumber at all implies 1 for a multiplier.  Following a relative item bythe string @samp{ago} is equivalent to preceding the unit by amultiplier with value @math{-1}.@findex day @r{in date strings}@findex tomorrow @r{in date strings}@findex yesterday @r{in date strings}The string @samp{tomorrow} is worth one day in the future (equivalentto @samp{day}), the string @samp{yesterday} is worthone day in the past (equivalent to @samp{day ago}).@findex now @r{in date strings}@findex today @r{in date strings}@findex this @r{in date strings}The strings @samp{now} or @samp{today} are relative items correspondingto zero-valued time displacement, these strings come from the facta zero-valued time displacement represents the current time when nototherwise changed by previous items.  They may be used to stress otheritems, like in @samp{12:00 today}.  The string @samp{this} also hasthe meaning of a zero-valued time displacement, but is preferred indate strings like @samp{this thursday}.When a relative item causes the resulting date to cross a boundarywhere the clocks were adjusted, typically for daylight-saving time,the resulting date and time are adjusted accordingly.@node Pure numbers in date strings@section Pure numbers in date strings@cindex pure numbers in date stringsThe precise interpretation of a pure decimal number dependson the context in the date string.If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and noother calendar date item (@pxref{Calendar date items}) appears before itin the date string, then @var{yyyy} is read as the year, @var{mm} as themonth number and @var{dd} as the day of the month, for the specifiedcalendar date.If the decimal number is of the form @var{hh}@var{mm} and no other timeof day item appears before it in the date string, then @var{hh} is readas the hour of the day and @var{mm} as the minute of the hour, for thespecified time of the day.  @var{mm} can also be omitted.If both a calendar date and a time of day appear to the left of a numberin the date string, but no relative item, then the number overrides theyear.@node Authors of getdate@section Authors of @code{getdate}@cindex authors of @code{getdate}@cindex Bellovin, Steven M.@cindex Salz, Rich@cindex Berets, Jim@cindex MacKenzie, David@cindex Meyering, Jim@cindex Eggert, Paul@code{getdate} was originally implemented by Steven M. Bellovin(@email{smb@@research.att.com}) while at the University of North Carolinaat Chapel Hill.  The code was later tweaked by a couple of people onUsenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})and Jim Berets (@email{jberets@@bbn.com}) in August, 1990.  Variousrevisions for the @sc{gnu} system were made by David MacKenzie, Jim Meyering,Paul Eggert and others.@cindex Pinard, F.@cindex Berry, K.This chapter was originally produced by Fran@,{c}ois Pinard(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -