Tcl Source Code

Hex Artifact Content
Login

Artifact 6da8dea4d43e025a648211078679a1f2285d3ae75c2a36a4a840595eab91f905:


0000: 27 5c 22 0a 27 5c 22 20 47 65 6e 65 72 61 74 65  '\".'\" Generate
0010: 64 20 66 72 6f 6d 20 66 69 6c 65 20 27 2e 2f 64  d from file './d
0020: 6f 63 2f 63 6c 6f 63 6b 2e 64 74 27 20 62 79 20  oc/clock.dt' by 
0030: 74 63 6c 6c 69 62 2f 64 6f 63 74 6f 6f 6c 73 20  tcllib/doctools 
0040: 77 69 74 68 20 66 6f 72 6d 61 74 20 27 6e 72 6f  with format 'nro
0050: 66 66 27 0a 27 5c 22 20 43 6f 70 79 72 69 67 68  ff'.'\" Copyrigh
0060: 74 20 28 63 29 20 32 30 30 34 20 4b 65 76 69 6e  t (c) 2004 Kevin
0070: 20 42 2e 20 4b 65 6e 6e 79 20 3c 6b 65 6e 6e 79   B. Kenny <kenny
0080: 6b 62 40 61 63 6d 2e 6f 72 67 3e 2e 20 41 6c 6c  [email protected]>. All
0090: 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64   rights reserved
00a0: 2e 0a 27 5c 22 0a 2e 54 48 20 22 63 6c 6f 63 6b  ..'\"..TH "clock
00b0: 22 20 6e 20 38 2e 35 20 54 63 6c 20 22 54 63 6c  " n 8.5 Tcl "Tcl
00c0: 20 42 75 69 6c 74 2d 49 6e 20 43 6f 6d 6d 61 6e   Built-In Comman
00d0: 64 73 22 0a 2e 73 6f 20 6d 61 6e 2e 6d 61 63 72  ds"..so man.macr
00e0: 6f 73 0a 2e 42 53 0a 2e 53 48 20 4e 41 4d 45 0a  os..BS..SH NAME.
00f0: 63 6c 6f 63 6b 20 5c 2d 20 4f 62 74 61 69 6e 20  clock \- Obtain 
0100: 61 6e 64 20 6d 61 6e 69 70 75 6c 61 74 65 20 64  and manipulate d
0110: 61 74 65 73 20 61 6e 64 20 74 69 6d 65 73 0a 2e  ates and times..
0120: 53 48 20 22 53 59 4e 4f 50 53 49 53 22 0a 2e 6e  SH "SYNOPSIS"..n
0130: 66 0a 70 61 63 6b 61 67 65 20 72 65 71 75 69 72  f.package requir
0140: 65 20 5c 66 42 54 63 6c 20 38 2e 35 2d 5c 66 52  e \fBTcl 8.5-\fR
0150: 0a 0a 5c 66 42 63 6c 6f 63 6b 20 61 64 64 5c 66  ..\fBclock add\f
0160: 49 20 74 69 6d 65 56 61 6c 5c 66 52 20 3f 5c 66  I timeVal\fR ?\f
0170: 49 63 6f 75 6e 74 20 75 6e 69 74 2e 2e 2e 5c 66  Icount unit...\f
0180: 52 3f 20 3f 5c 66 49 5c 2d 6f 70 74 69 6f 6e 20  R? ?\fI\-option 
0190: 76 61 6c 75 65 5c 66 52 3f 0a 5c 66 42 63 6c 6f  value\fR?.\fBclo
01a0: 63 6b 20 63 6c 69 63 6b 73 5c 66 52 20 3f 5c 66  ck clicks\fR ?\f
01b0: 49 5c 2d 6f 70 74 69 6f 6e 5c 66 52 3f 0a 5c 66  I\-option\fR?.\f
01c0: 42 63 6c 6f 63 6b 20 66 6f 72 6d 61 74 5c 66 49  Bclock format\fI
01d0: 20 74 69 6d 65 56 61 6c 5c 66 52 20 3f 5c 66 49   timeVal\fR ?\fI
01e0: 5c 2d 6f 70 74 69 6f 6e 20 76 61 6c 75 65 5c 66  \-option value\f
01f0: 52 2e 2e 2e 3f 0a 5c 66 42 63 6c 6f 63 6b 20 6d  R...?.\fBclock m
0200: 69 63 72 6f 73 65 63 6f 6e 64 73 5c 66 52 0a 5c  icroseconds\fR.\
0210: 66 42 63 6c 6f 63 6b 20 6d 69 6c 6c 69 73 65 63  fBclock millisec
0220: 6f 6e 64 73 5c 66 52 0a 5c 66 42 63 6c 6f 63 6b  onds\fR.\fBclock
0230: 20 73 63 61 6e 5c 66 49 20 69 6e 70 75 74 53 74   scan\fI inputSt
0240: 72 69 6e 67 5c 66 52 20 3f 5c 66 49 5c 2d 6f 70  ring\fR ?\fI\-op
0250: 74 69 6f 6e 20 76 61 6c 75 65 5c 66 52 2e 2e 2e  tion value\fR...
0260: 3f 0a 5c 66 42 63 6c 6f 63 6b 20 73 65 63 6f 6e  ?.\fBclock secon
0270: 64 73 5c 66 52 0a 2e 66 69 0a 2e 42 45 0a 2e 53  ds\fR..fi..BE..S
0280: 48 20 22 44 45 53 43 52 49 50 54 49 4f 4e 22 0a  H "DESCRIPTION".
0290: 2e 50 50 0a 54 68 65 20 5c 66 42 63 6c 6f 63 6b  .PP.The \fBclock
02a0: 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 70 65 72 66  \fR command perf
02b0: 6f 72 6d 73 20 73 65 76 65 72 61 6c 20 6f 70 65  orms several ope
02c0: 72 61 74 69 6f 6e 73 20 74 68 61 74 20 6f 62 74  rations that obt
02d0: 61 69 6e 20 61 6e 64 0a 6d 61 6e 69 70 75 6c 61  ain and.manipula
02e0: 74 65 20 76 61 6c 75 65 73 20 74 68 61 74 20 72  te values that r
02f0: 65 70 72 65 73 65 6e 74 20 74 69 6d 65 73 2e 20  epresent times. 
0300: 20 54 68 65 20 63 6f 6d 6d 61 6e 64 20 73 75 70   The command sup
0310: 70 6f 72 74 73 20 73 65 76 65 72 61 6c 0a 73 75  ports several.su
0320: 62 63 6f 6d 6d 61 6e 64 73 20 74 68 61 74 20 64  bcommands that d
0330: 65 74 65 72 6d 69 6e 65 20 77 68 61 74 20 61 63  etermine what ac
0340: 74 69 6f 6e 20 69 73 20 63 61 72 72 69 65 64 20  tion is carried 
0350: 6f 75 74 20 62 79 20 74 68 65 20 63 6f 6d 6d 61  out by the comma
0360: 6e 64 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20  nd...\" METHOD: 
0370: 61 64 64 0a 2e 54 50 0a 5c 66 42 63 6c 6f 63 6b  add..TP.\fBclock
0380: 20 61 64 64 5c 66 49 20 74 69 6d 65 56 61 6c 5c   add\fI timeVal\
0390: 66 52 20 3f 5c 66 49 63 6f 75 6e 74 20 75 6e 69  fR ?\fIcount uni
03a0: 74 2e 2e 2e 5c 66 52 3f 20 3f 5c 66 49 5c 2d 6f  t...\fR? ?\fI\-o
03b0: 70 74 69 6f 6e 20 76 61 6c 75 65 5c 66 52 3f 0a  ption value\fR?.
03c0: 2e 0a 41 64 64 73 20 61 20 28 70 6f 73 73 69 62  ..Adds a (possib
03d0: 6c 79 20 6e 65 67 61 74 69 76 65 29 20 6f 66 66  ly negative) off
03e0: 73 65 74 20 74 6f 20 61 20 74 69 6d 65 20 74 68  set to a time th
03f0: 61 74 20 69 73 20 65 78 70 72 65 73 73 65 64 20  at is expressed 
0400: 61 73 20 61 6e 0a 69 6e 74 65 67 65 72 20 6e 75  as an.integer nu
0410: 6d 62 65 72 20 6f 66 20 73 65 63 6f 6e 64 73 2e  mber of seconds.
0420: 20 20 53 65 65 20 5c 66 42 43 4c 4f 43 4b 20 41    See \fBCLOCK A
0430: 52 49 54 48 4d 45 54 49 43 5c 66 52 20 66 6f 72  RITHMETIC\fR for
0440: 20 61 20 66 75 6c 6c 20 64 65 73 63 72 69 70 74   a full descript
0450: 69 6f 6e 2e 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a  ion...\" METHOD:
0460: 20 63 6c 69 63 6b 73 0a 2e 54 50 0a 5c 66 42 63   clicks..TP.\fBc
0470: 6c 6f 63 6b 20 63 6c 69 63 6b 73 5c 66 52 20 3f  lock clicks\fR ?
0480: 5c 66 49 5c 2d 6f 70 74 69 6f 6e 5c 66 52 3f 0a  \fI\-option\fR?.
0490: 2e 0a 49 66 20 6e 6f 20 5c 66 49 5c 2d 6f 70 74  ..If no \fI\-opt
04a0: 69 6f 6e 5c 66 52 20 61 72 67 75 6d 65 6e 74 20  ion\fR argument 
04b0: 69 73 20 73 75 70 70 6c 69 65 64 2c 20 72 65 74  is supplied, ret
04c0: 75 72 6e 73 20 61 20 68 69 67 68 2d 72 65 73 6f  urns a high-reso
04d0: 6c 75 74 69 6f 6e 0a 74 69 6d 65 20 76 61 6c 75  lution.time valu
04e0: 65 20 61 73 20 61 20 73 79 73 74 65 6d 2d 64 65  e as a system-de
04f0: 70 65 6e 64 65 6e 74 20 69 6e 74 65 67 65 72 20  pendent integer 
0500: 76 61 6c 75 65 2e 20 20 54 68 65 20 75 6e 69 74  value.  The unit
0510: 20 6f 66 20 74 68 65 20 76 61 6c 75 65 0a 69 73   of the value.is
0520: 20 73 79 73 74 65 6d 2d 64 65 70 65 6e 64 65 6e   system-dependen
0530: 74 20 62 75 74 20 73 68 6f 75 6c 64 20 62 65 20  t but should be 
0540: 74 68 65 20 68 69 67 68 65 73 74 20 72 65 73 6f  the highest reso
0550: 6c 75 74 69 6f 6e 20 63 6c 6f 63 6b 20 61 76 61  lution clock ava
0560: 69 6c 61 62 6c 65 0a 6f 6e 20 74 68 65 20 73 79  ilable.on the sy
0570: 73 74 65 6d 20 73 75 63 68 20 61 73 20 61 20 43  stem such as a C
0580: 50 55 20 63 79 63 6c 65 20 63 6f 75 6e 74 65 72  PU cycle counter
0590: 2e 0a 53 65 65 20 5c 66 42 48 49 47 48 20 52 45  ..See \fBHIGH RE
05a0: 53 4f 4c 55 54 49 4f 4e 20 54 49 4d 45 52 53 5c  SOLUTION TIMERS\
05b0: 66 52 20 66 6f 72 20 61 20 66 75 6c 6c 20 64 65  fR for a full de
05c0: 73 63 72 69 70 74 69 6f 6e 2e 0a 2e 52 53 0a 2e  scription...RS..
05d0: 50 50 0a 49 66 20 74 68 65 20 5c 66 49 5c 2d 6f  PP.If the \fI\-o
05e0: 70 74 69 6f 6e 5c 66 52 20 61 72 67 75 6d 65 6e  ption\fR argumen
05f0: 74 20 69 73 20 5c 66 42 5c 2d 6d 69 6c 6c 69 73  t is \fB\-millis
0600: 65 63 6f 6e 64 73 5c 66 52 2c 20 74 68 65 6e 20  econds\fR, then 
0610: 74 68 65 20 63 6f 6d 6d 61 6e 64 0a 69 73 20 73  the command.is s
0620: 79 6e 6f 6e 79 6d 6f 75 73 20 77 69 74 68 20 5c  ynonymous with \
0630: 66 42 63 6c 6f 63 6b 20 6d 69 6c 6c 69 73 65 63  fBclock millisec
0640: 6f 6e 64 73 5c 66 52 20 28 73 65 65 20 62 65 6c  onds\fR (see bel
0650: 6f 77 29 2e 20 20 54 68 69 73 0a 75 73 61 67 65  ow).  This.usage
0660: 20 69 73 20 6f 62 73 6f 6c 65 74 65 2c 20 61 6e   is obsolete, an
0670: 64 20 5c 66 42 63 6c 6f 63 6b 20 6d 69 6c 6c 69  d \fBclock milli
0680: 73 65 63 6f 6e 64 73 5c 66 52 20 69 73 20 74 6f  seconds\fR is to
0690: 20 62 65 0a 63 6f 6e 73 69 64 65 72 65 64 20 74   be.considered t
06a0: 68 65 20 70 72 65 66 65 72 72 65 64 20 77 61 79  he preferred way
06b0: 20 6f 66 20 6f 62 74 61 69 6e 69 6e 67 20 61 20   of obtaining a 
06c0: 63 6f 75 6e 74 20 6f 66 20 6d 69 6c 6c 69 73 65  count of millise
06d0: 63 6f 6e 64 73 2e 0a 2e 50 50 0a 49 66 20 74 68  conds...PP.If th
06e0: 65 20 5c 66 49 5c 2d 6f 70 74 69 6f 6e 5c 66 52  e \fI\-option\fR
06f0: 20 61 72 67 75 6d 65 6e 74 20 69 73 20 5c 66 42   argument is \fB
0700: 5c 2d 6d 69 63 72 6f 73 65 63 6f 6e 64 73 5c 66  \-microseconds\f
0710: 52 2c 20 74 68 65 6e 20 74 68 65 20 63 6f 6d 6d  R, then the comm
0720: 61 6e 64 0a 69 73 20 73 79 6e 6f 6e 79 6d 6f 75  and.is synonymou
0730: 73 20 77 69 74 68 20 5c 66 42 63 6c 6f 63 6b 20  s with \fBclock 
0740: 6d 69 63 72 6f 73 65 63 6f 6e 64 73 5c 66 52 20  microseconds\fR 
0750: 28 73 65 65 20 62 65 6c 6f 77 29 2e 20 20 54 68  (see below).  Th
0760: 69 73 0a 75 73 61 67 65 20 69 73 20 6f 62 73 6f  is.usage is obso
0770: 6c 65 74 65 2c 20 61 6e 64 20 5c 66 42 63 6c 6f  lete, and \fBclo
0780: 63 6b 20 6d 69 63 72 6f 73 65 63 6f 6e 64 73 5c  ck microseconds\
0790: 66 52 20 69 73 20 74 6f 20 62 65 0a 63 6f 6e 73  fR is to be.cons
07a0: 69 64 65 72 65 64 20 74 68 65 20 70 72 65 66 65  idered the prefe
07b0: 72 72 65 64 20 77 61 79 20 6f 66 20 6f 62 74 61  rred way of obta
07c0: 69 6e 69 6e 67 20 61 20 63 6f 75 6e 74 20 6f 66  ining a count of
07d0: 20 6d 69 63 72 6f 73 65 63 6f 6e 64 73 2e 0a 2e   microseconds...
07e0: 52 45 0a 2e 5c 22 20 4d 45 54 48 4f 44 3a 20 66  RE..\" METHOD: f
07f0: 6f 72 6d 61 74 0a 2e 54 50 0a 5c 66 42 63 6c 6f  ormat..TP.\fBclo
0800: 63 6b 20 66 6f 72 6d 61 74 5c 66 49 20 74 69 6d  ck format\fI tim
0810: 65 56 61 6c 5c 66 52 20 3f 5c 66 49 5c 2d 6f 70  eVal\fR ?\fI\-op
0820: 74 69 6f 6e 20 76 61 6c 75 65 5c 66 52 2e 2e 2e  tion value\fR...
0830: 3f 0a 2e 0a 46 6f 72 6d 61 74 73 20 61 20 74 69  ?...Formats a ti
0840: 6d 65 20 74 68 61 74 20 69 73 20 65 78 70 72 65  me that is expre
0850: 73 73 65 64 20 61 73 20 61 6e 20 69 6e 74 65 67  ssed as an integ
0860: 65 72 20 6e 75 6d 62 65 72 20 6f 66 20 73 65 63  er number of sec
0870: 6f 6e 64 73 20 69 6e 74 6f 20 61 20 66 6f 72 6d  onds into a form
0880: 61 74 0a 69 6e 74 65 6e 64 65 64 20 66 6f 72 20  at.intended for 
0890: 63 6f 6e 73 75 6d 70 74 69 6f 6e 20 62 79 20 75  consumption by u
08a0: 73 65 72 73 20 6f 72 20 65 78 74 65 72 6e 61 6c  sers or external
08b0: 20 70 72 6f 67 72 61 6d 73 2e 0a 53 65 65 20 5c   programs..See \
08c0: 66 42 46 4f 52 4d 41 54 54 49 4e 47 20 54 49 4d  fBFORMATTING TIM
08d0: 45 53 5c 66 52 20 66 6f 72 20 61 20 66 75 6c 6c  ES\fR for a full
08e0: 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 0a 2e 5c   description...\
08f0: 22 20 4d 45 54 48 4f 44 3a 20 6d 69 63 72 6f 73  " METHOD: micros
0900: 65 63 6f 6e 64 73 0a 2e 54 50 0a 5c 66 42 63 6c  econds..TP.\fBcl
0910: 6f 63 6b 20 6d 69 63 72 6f 73 65 63 6f 6e 64 73  ock microseconds
0920: 5c 66 52 0a 2e 0a 52 65 74 75 72 6e 73 20 74 68  \fR...Returns th
0930: 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 61  e current time a
0940: 73 20 61 6e 20 69 6e 74 65 67 65 72 20 6e 75 6d  s an integer num
0950: 62 65 72 20 6f 66 20 6d 69 63 72 6f 73 65 63 6f  ber of microseco
0960: 6e 64 73 2e 0a 53 65 65 20 5c 66 42 48 49 47 48  nds..See \fBHIGH
0970: 20 52 45 53 4f 4c 55 54 49 4f 4e 20 54 49 4d 45   RESOLUTION TIME
0980: 52 53 5c 66 52 20 66 6f 72 20 61 20 66 75 6c 6c  RS\fR for a full
0990: 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 0a 2e 5c   description...\
09a0: 22 20 4d 45 54 48 4f 44 3a 20 6d 69 6c 6c 69 73  " METHOD: millis
09b0: 65 63 6f 6e 64 73 0a 2e 54 50 0a 5c 66 42 63 6c  econds..TP.\fBcl
09c0: 6f 63 6b 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 73  ock milliseconds
09d0: 5c 66 52 0a 2e 0a 52 65 74 75 72 6e 73 20 74 68  \fR...Returns th
09e0: 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 61  e current time a
09f0: 73 20 61 6e 20 69 6e 74 65 67 65 72 20 6e 75 6d  s an integer num
0a00: 62 65 72 20 6f 66 20 6d 69 6c 6c 69 73 65 63 6f  ber of milliseco
0a10: 6e 64 73 2e 0a 53 65 65 20 5c 66 42 48 49 47 48  nds..See \fBHIGH
0a20: 20 52 45 53 4f 4c 55 54 49 4f 4e 20 54 49 4d 45   RESOLUTION TIME
0a30: 52 53 5c 66 52 20 66 6f 72 20 61 20 66 75 6c 6c  RS\fR for a full
0a40: 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 0a 2e 5c   description...\
0a50: 22 20 4d 45 54 48 4f 44 3a 20 73 63 61 6e 0a 2e  " METHOD: scan..
0a60: 54 50 0a 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e  TP.\fBclock scan
0a70: 5c 66 49 20 69 6e 70 75 74 53 74 72 69 6e 67 5c  \fI inputString\
0a80: 66 52 20 3f 5c 66 49 5c 2d 6f 70 74 69 6f 6e 20  fR ?\fI\-option 
0a90: 76 61 6c 75 65 5c 66 52 2e 2e 2e 3f 0a 2e 0a 53  value\fR...?...S
0aa0: 63 61 6e 73 20 61 20 74 69 6d 65 20 74 68 61 74  cans a time that
0ab0: 20 69 73 20 65 78 70 72 65 73 73 65 64 20 61 73   is expressed as
0ac0: 20 61 20 63 68 61 72 61 63 74 65 72 20 73 74 72   a character str
0ad0: 69 6e 67 20 61 6e 64 20 70 72 6f 64 75 63 65 73  ing and produces
0ae0: 20 61 6e 0a 69 6e 74 65 67 65 72 20 6e 75 6d 62   an.integer numb
0af0: 65 72 20 6f 66 20 73 65 63 6f 6e 64 73 2e 0a 53  er of seconds..S
0b00: 65 65 20 5c 66 42 53 43 41 4e 4e 49 4e 47 20 54  ee \fBSCANNING T
0b10: 49 4d 45 53 5c 66 52 20 66 6f 72 20 61 20 66 75  IMES\fR for a fu
0b20: 6c 6c 20 64 65 73 63 72 69 70 74 69 6f 6e 2e 0a  ll description..
0b30: 2e 5c 22 20 4d 45 54 48 4f 44 3a 20 73 65 63 6f  .\" METHOD: seco
0b40: 6e 64 73 0a 2e 54 50 0a 5c 66 42 63 6c 6f 63 6b  nds..TP.\fBclock
0b50: 20 73 65 63 6f 6e 64 73 5c 66 52 0a 2e 0a 52 65   seconds\fR...Re
0b60: 74 75 72 6e 73 20 74 68 65 20 63 75 72 72 65 6e  turns the curren
0b70: 74 20 74 69 6d 65 20 61 73 20 61 6e 20 69 6e 74  t time as an int
0b80: 65 67 65 72 20 6e 75 6d 62 65 72 20 6f 66 20 73  eger number of s
0b90: 65 63 6f 6e 64 73 2e 0a 2e 53 53 20 22 50 41 52  econds...SS "PAR
0ba0: 41 4d 45 54 45 52 53 22 0a 2e 54 50 0a 5c 66 49  AMETERS"..TP.\fI
0bb0: 63 6f 75 6e 74 5c 66 52 0a 2e 0a 41 6e 20 69 6e  count\fR...An in
0bc0: 74 65 67 65 72 20 72 65 70 72 65 73 65 6e 74 69  teger representi
0bd0: 6e 67 20 61 20 63 6f 75 6e 74 20 6f 66 20 73 6f  ng a count of so
0be0: 6d 65 20 75 6e 69 74 20 6f 66 20 74 69 6d 65 2e  me unit of time.
0bf0: 20 20 53 65 65 0a 5c 66 42 43 4c 4f 43 4b 20 41    See.\fBCLOCK A
0c00: 52 49 54 48 4d 45 54 49 43 5c 66 52 20 66 6f 72  RITHMETIC\fR for
0c10: 20 74 68 65 20 64 65 74 61 69 6c 73 2e 0a 2e 54   the details...T
0c20: 50 0a 5c 66 49 74 69 6d 65 56 61 6c 5c 66 52 0a  P.\fItimeVal\fR.
0c30: 2e 0a 41 6e 20 69 6e 74 65 67 65 72 20 76 61 6c  ..An integer val
0c40: 75 65 20 70 61 73 73 65 64 20 74 6f 20 74 68 65  ue passed to the
0c50: 20 5c 66 42 63 6c 6f 63 6b 5c 66 52 20 63 6f 6d   \fBclock\fR com
0c60: 6d 61 6e 64 20 74 68 61 74 20 72 65 70 72 65 73  mand that repres
0c70: 65 6e 74 73 20 61 6e 0a 61 62 73 6f 6c 75 74 65  ents an.absolute
0c80: 20 74 69 6d 65 20 61 73 20 61 20 6e 75 6d 62 65   time as a numbe
0c90: 72 20 6f 66 20 73 65 63 6f 6e 64 73 20 66 72 6f  r of seconds fro
0ca0: 6d 20 74 68 65 20 5c 66 49 65 70 6f 63 68 20 74  m the \fIepoch t
0cb0: 69 6d 65 5c 66 52 20 6f 66 0a 31 20 4a 61 6e 75  ime\fR of.1 Janu
0cc0: 61 72 79 20 31 39 37 30 2c 20 30 30 3a 30 30 20  ary 1970, 00:00 
0cd0: 55 54 43 2e 20 20 4e 6f 74 65 20 74 68 61 74 20  UTC.  Note that 
0ce0: 74 68 65 20 63 6f 75 6e 74 20 6f 66 20 73 65 63  the count of sec
0cf0: 6f 6e 64 73 20 64 6f 65 73 20 6e 6f 74 0a 69 6e  onds does not.in
0d00: 63 6c 75 64 65 20 61 6e 79 20 6c 65 61 70 20 73  clude any leap s
0d10: 65 63 6f 6e 64 73 3b 20 73 65 63 6f 6e 64 73 20  econds; seconds 
0d20: 61 72 65 20 63 6f 75 6e 74 65 64 20 61 73 20 69  are counted as i
0d30: 66 20 65 61 63 68 20 55 54 43 20 64 61 79 20 68  f each UTC day h
0d40: 61 73 0a 65 78 61 63 74 6c 79 20 38 36 34 30 30  as.exactly 86400
0d50: 20 73 65 63 6f 6e 64 73 2e 20 20 54 63 6c 20 72   seconds.  Tcl r
0d60: 65 73 70 6f 6e 64 73 20 74 6f 20 6c 65 61 70 20  esponds to leap 
0d70: 73 65 63 6f 6e 64 73 20 62 79 20 73 70 65 65 64  seconds by speed
0d80: 69 6e 67 20 6f 72 0a 73 6c 6f 77 69 6e 67 20 69  ing or.slowing i
0d90: 74 73 20 63 6c 6f 63 6b 20 62 79 20 61 20 74 69  ts clock by a ti
0da0: 6e 79 20 66 72 61 63 74 69 6f 6e 20 66 6f 72 20  ny fraction for 
0db0: 73 6f 6d 65 20 6d 69 6e 75 74 65 73 20 75 6e 74  some minutes unt
0dc0: 69 6c 20 69 74 20 69 73 0a 62 61 63 6b 20 69 6e  il it is.back in
0dd0: 20 73 79 6e 63 20 77 69 74 68 20 55 54 43 3b 20   sync with UTC; 
0de0: 69 74 73 20 64 61 74 61 20 6d 6f 64 65 6c 20 64  its data model d
0df0: 6f 65 73 20 6e 6f 74 20 72 65 70 72 65 73 65 6e  oes not represen
0e00: 74 20 6d 69 6e 75 74 65 73 20 74 68 61 74 0a 68  t minutes that.h
0e10: 61 76 65 20 35 39 20 6f 72 20 36 31 20 73 65 63  ave 59 or 61 sec
0e20: 6f 6e 64 73 2e 0a 2e 54 50 0a 5c 66 49 5c 2d 6e  onds...TP.\fI\-n
0e30: 6f 77 5c 66 52 0a 49 6e 73 74 65 61 64 20 6f 66  ow\fR.Instead of
0e40: 20 5c 66 49 74 69 6d 65 56 61 6c 5c 66 52 20 61   \fItimeVal\fR a
0e50: 20 6e 6f 6e 2d 69 6e 74 65 67 65 72 20 6f 70 74   non-integer opt
0e60: 69 6f 6e 20 5c 66 49 5c 2d 6e 6f 77 5c 66 52 20  ion \fI\-now\fR 
0e70: 63 61 6e 20 62 65 20 75 73 65 64 20 61 73 0a 72  can be used as.r
0e80: 65 70 6c 61 63 65 6d 65 6e 74 20 66 6f 72 20 74  eplacement for t
0e90: 6f 64 61 79 2c 20 77 68 69 63 68 20 69 73 20 73  oday, which is s
0ea0: 69 6d 70 6c 79 20 69 6e 74 65 72 70 6f 6c 61 74  imply interpolat
0eb0: 65 64 20 74 6f 20 74 68 65 20 72 75 6e 74 2d 74  ed to the runt-t
0ec0: 69 6d 65 20 61 73 20 76 61 6c 75 65 0a 6f 66 20  ime as value.of 
0ed0: 5c 66 42 63 6c 6f 63 6b 20 73 65 63 6f 6e 64 73  \fBclock seconds
0ee0: 5c 66 52 2e 20 46 6f 72 20 65 78 61 6d 70 6c 65  \fR. For example
0ef0: 3a 0a 2e 73 70 0a 5c 66 42 63 6c 6f 63 6b 20 66  :..sp.\fBclock f
0f00: 6f 72 6d 61 74 20 2d 6e 6f 77 20 2d 66 20 25 61  ormat -now -f %a
0f10: 3b 20 23 20 63 75 72 72 65 6e 74 20 64 61 79 20  ; # current day 
0f20: 6f 66 20 74 68 65 20 77 65 65 6b 5c 66 52 0a 2e  of the week\fR..
0f30: 73 70 0a 5c 66 42 63 6c 6f 63 6b 20 61 64 64 20  sp.\fBclock add 
0f40: 2d 6e 6f 77 20 31 20 6d 6f 6e 74 68 3b 20 23 20  -now 1 month; # 
0f50: 6e 65 78 74 20 6d 6f 6e 74 68 5c 66 52 0a 2e 54  next month\fR..T
0f60: 50 0a 5c 66 49 75 6e 69 74 5c 66 52 0a 2e 0a 4f  P.\fIunit\fR...O
0f70: 6e 65 20 6f 66 20 74 68 65 20 77 6f 72 64 73 2c  ne of the words,
0f80: 20 5c 66 42 73 65 63 6f 6e 64 73 5c 66 52 2c 20   \fBseconds\fR, 
0f90: 5c 66 42 6d 69 6e 75 74 65 73 5c 66 52 2c 20 5c  \fBminutes\fR, \
0fa0: 66 42 68 6f 75 72 73 5c 66 52 2c 0a 5c 66 42 64  fBhours\fR,.\fBd
0fb0: 61 79 73 5c 66 52 2c 20 5c 66 42 77 65 65 6b 64  ays\fR, \fBweekd
0fc0: 61 79 73 5c 66 52 2c 20 5c 66 42 77 65 65 6b 73  ays\fR, \fBweeks
0fd0: 5c 66 52 2c 20 5c 66 42 6d 6f 6e 74 68 73 5c 66  \fR, \fBmonths\f
0fe0: 52 2c 20 6f 72 20 5c 66 42 79 65 61 72 73 5c 66  R, or \fByears\f
0ff0: 52 2e 0a 55 73 65 64 20 69 6e 20 63 6f 6e 6a 75  R..Used in conju
1000: 6e 63 74 69 6f 6e 20 77 69 74 68 20 5c 66 49 63  nction with \fIc
1010: 6f 75 6e 74 5c 66 52 20 74 6f 20 69 64 65 6e 74  ount\fR to ident
1020: 69 66 79 20 61 6e 20 69 6e 74 65 72 76 61 6c 20  ify an interval 
1030: 6f 66 20 74 69 6d 65 2c 0a 66 6f 72 20 65 78 61  of time,.for exa
1040: 6d 70 6c 65 2c 20 5c 66 49 33 20 73 65 63 6f 6e  mple, \fI3 secon
1050: 64 73 5c 66 52 20 6f 72 20 5c 66 49 31 20 79 65  ds\fR or \fI1 ye
1060: 61 72 5c 66 52 2e 0a 2e 53 53 20 22 4f 50 54 49  ar\fR...SS "OPTI
1070: 4f 4e 53 22 0a 2e 5c 22 20 4f 50 54 49 4f 4e 3a  ONS"..\" OPTION:
1080: 20 2d 62 61 73 65 0a 2e 54 50 0a 5c 66 42 5c 2d   -base..TP.\fB\-
1090: 62 61 73 65 5c 66 52 20 74 69 6d 65 0a 2e 0a 53  base\fR time...S
10a0: 70 65 63 69 66 69 65 73 20 74 68 61 74 20 61 6e  pecifies that an
10b0: 79 20 72 65 6c 61 74 69 76 65 20 74 69 6d 65 73  y relative times
10c0: 20 70 72 65 73 65 6e 74 20 69 6e 20 61 20 5c 66   present in a \f
10d0: 42 63 6c 6f 63 6b 20 73 63 61 6e 5c 66 52 20 63  Bclock scan\fR c
10e0: 6f 6d 6d 61 6e 64 0a 61 72 65 20 74 6f 20 62 65  ommand.are to be
10f0: 20 67 69 76 65 6e 20 72 65 6c 61 74 69 76 65 20   given relative 
1100: 74 6f 20 5c 66 49 74 69 6d 65 5c 66 52 2e 20 20  to \fItime\fR.  
1110: 5c 66 49 74 69 6d 65 5c 66 52 20 6d 75 73 74 20  \fItime\fR must 
1120: 62 65 20 65 78 70 72 65 73 73 65 64 20 61 73 0a  be expressed as.
1130: 61 20 63 6f 75 6e 74 20 6f 66 20 6e 6f 6d 69 6e  a count of nomin
1140: 61 6c 20 73 65 63 6f 6e 64 73 20 66 72 6f 6d 20  al seconds from 
1150: 74 68 65 20 65 70 6f 63 68 20 74 69 6d 65 20 6f  the epoch time o
1160: 66 20 31 20 4a 61 6e 75 61 72 79 20 31 39 37 30  f 1 January 1970
1170: 2c 20 30 30 3a 30 30 20 55 54 43 2e 0a 2e 5c 22  , 00:00 UTC...\"
1180: 20 4f 50 54 49 4f 4e 3a 20 2d 66 6f 72 6d 61 74   OPTION: -format
1190: 0a 2e 54 50 0a 5c 66 42 5c 2d 66 6f 72 6d 61 74  ..TP.\fB\-format
11a0: 5c 66 52 20 66 6f 72 6d 61 74 0a 2e 0a 53 70 65  \fR format...Spe
11b0: 63 69 66 69 65 73 20 74 68 65 20 64 65 73 69 72  cifies the desir
11c0: 65 64 20 6f 75 74 70 75 74 20 66 6f 72 6d 61 74  ed output format
11d0: 20 66 6f 72 20 5c 66 42 63 6c 6f 63 6b 20 66 6f   for \fBclock fo
11e0: 72 6d 61 74 5c 66 52 20 6f 72 20 74 68 65 0a 65  rmat\fR or the.e
11f0: 78 70 65 63 74 65 64 20 69 6e 70 75 74 20 66 6f  xpected input fo
1200: 72 6d 61 74 20 66 6f 72 20 5c 66 42 63 6c 6f 63  rmat for \fBcloc
1210: 6b 20 73 63 61 6e 5c 66 52 2e 20 20 54 68 65 20  k scan\fR.  The 
1220: 5c 66 49 66 6f 72 6d 61 74 5c 66 52 20 73 74 72  \fIformat\fR str
1230: 69 6e 67 20 63 6f 6e 73 69 73 74 73 0a 6f 66 20  ing consists.of 
1240: 61 6e 79 20 6e 75 6d 62 65 72 20 6f 66 20 63 68  any number of ch
1250: 61 72 61 63 74 65 72 73 20 6f 74 68 65 72 20 74  aracters other t
1260: 68 61 6e 20 74 68 65 20 70 65 72 2d 63 65 6e 74  han the per-cent
1270: 20 73 69 67 6e 0a 2e 50 51 20 5c 66 42 25 5c 66   sign..PQ \fB%\f
1280: 52 0a 69 6e 74 65 72 73 70 65 72 73 65 64 20 77  R.interspersed w
1290: 69 74 68 20 61 6e 79 20 6e 75 6d 62 65 72 20 6f  ith any number o
12a0: 66 20 5c 66 49 66 6f 72 6d 61 74 20 67 72 6f 75  f \fIformat grou
12b0: 70 73 5c 66 52 2c 20 77 68 69 63 68 20 61 72 65  ps\fR, which are
12c0: 20 74 77 6f 2d 20 6f 72 20 74 68 72 65 65 2d 63   two- or three-c
12d0: 68 61 72 61 63 74 65 72 0a 73 65 71 75 65 6e 63  haracter.sequenc
12e0: 65 73 20 62 65 67 69 6e 6e 69 6e 67 20 77 69 74  es beginning wit
12f0: 68 20 74 68 65 20 70 65 72 2d 63 65 6e 74 20 73  h the per-cent s
1300: 69 67 6e 2e 20 20 54 68 65 20 70 65 72 6d 69 73  ign.  The permis
1310: 73 69 62 6c 65 20 66 6f 72 6d 61 74 20 67 72 6f  sible format gro
1320: 75 70 73 2c 0a 61 6e 64 20 74 68 65 69 72 20 69  ups,.and their i
1330: 6e 74 65 72 70 72 65 74 61 74 69 6f 6e 2c 20 61  nterpretation, a
1340: 72 65 20 64 65 73 63 72 69 62 65 64 20 75 6e 64  re described und
1350: 65 72 20 5c 66 42 46 4f 52 4d 41 54 20 47 52 4f  er \fBFORMAT GRO
1360: 55 50 53 5c 66 52 2e 0a 2e 52 53 0a 2e 50 50 0a  UPS\fR...RS..PP.
1370: 4f 6e 20 5c 66 42 63 6c 6f 63 6b 20 66 6f 72 6d  On \fBclock form
1380: 61 74 5c 66 52 2c 20 74 68 65 20 64 65 66 61 75  at\fR, the defau
1390: 6c 74 20 66 6f 72 6d 61 74 20 69 73 0a 2e 50 50  lt format is..PP
13a0: 0a 2e 43 53 0a 25 61 20 25 62 20 25 64 20 25 48  ..CS.%a %b %d %H
13b0: 3a 25 4d 3a 25 53 20 25 5a 20 25 59 0a 2e 43 45  :%M:%S %Z %Y..CE
13c0: 0a 2e 50 50 0a 4f 6e 20 5c 66 42 63 6c 6f 63 6b  ..PP.On \fBclock
13d0: 20 73 63 61 6e 5c 66 52 2c 20 74 68 65 20 6c 61   scan\fR, the la
13e0: 63 6b 20 6f 66 20 61 20 5c 66 42 5c 2d 66 6f 72  ck of a \fB\-for
13f0: 6d 61 74 5c 66 52 20 6f 70 74 69 6f 6e 20 69 6e  mat\fR option in
1400: 64 69 63 61 74 65 73 20 74 68 61 74 20 61 0a 2e  dicates that a..
1410: 51 57 20 22 66 72 65 65 20 66 6f 72 6d 61 74 20  QW "free format 
1420: 73 63 61 6e 22 0a 69 73 20 72 65 71 75 65 73 74  scan".is request
1430: 65 64 3b 20 73 65 65 20 5c 66 42 46 52 45 45 20  ed; see \fBFREE 
1440: 46 4f 52 4d 20 53 43 41 4e 5c 66 52 20 66 6f 72  FORM SCAN\fR for
1450: 20 61 20 64 65 73 63 72 69 70 74 69 6f 6e 20 6f   a description o
1460: 66 20 77 68 61 74 20 68 61 70 70 65 6e 73 2e 0a  f what happens..
1470: 2e 52 45 0a 2e 5c 22 20 4f 50 54 49 4f 4e 3a 20  .RE..\" OPTION: 
1480: 2d 67 6d 74 0a 2e 54 50 0a 5c 66 42 5c 2d 67 6d  -gmt..TP.\fB\-gm
1490: 74 5c 66 52 20 62 6f 6f 6c 65 61 6e 0a 2e 0a 49  t\fR boolean...I
14a0: 66 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 20  f \fIboolean\fR 
14b0: 69 73 20 74 72 75 65 2c 20 73 70 65 63 69 66 69  is true, specifi
14c0: 65 73 20 74 68 61 74 20 61 20 74 69 6d 65 20 73  es that a time s
14d0: 70 65 63 69 66 69 65 64 20 74 6f 20 5c 66 42 63  pecified to \fBc
14e0: 6c 6f 63 6b 20 61 64 64 5c 66 52 2c 0a 5c 66 42  lock add\fR,.\fB
14f0: 63 6c 6f 63 6b 20 66 6f 72 6d 61 74 5c 66 52 20  clock format\fR 
1500: 6f 72 20 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e  or \fBclock scan
1510: 5c 66 52 20 73 68 6f 75 6c 64 20 62 65 20 70 72  \fR should be pr
1520: 6f 63 65 73 73 65 64 20 69 6e 0a 55 54 43 2e 20  ocessed in.UTC. 
1530: 20 49 66 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66   If \fIboolean\f
1540: 52 20 69 73 20 66 61 6c 73 65 2c 20 74 68 65 20  R is false, the 
1550: 70 72 6f 63 65 73 73 69 6e 67 20 64 65 66 61 75  processing defau
1560: 6c 74 73 20 74 6f 20 74 68 65 20 6c 6f 63 61 6c  lts to the local
1570: 20 74 69 6d 65 0a 7a 6f 6e 65 2e 20 20 54 68 69   time.zone.  Thi
1580: 73 20 75 73 61 67 65 20 69 73 20 6f 62 73 6f 6c  s usage is obsol
1590: 65 74 65 3b 20 74 68 65 20 63 6f 72 72 65 63 74  ete; the correct
15a0: 20 63 75 72 72 65 6e 74 20 75 73 61 67 65 20 69   current usage i
15b0: 73 20 74 6f 0a 73 70 65 63 69 66 79 20 74 68 65  s to.specify the
15c0: 20 55 54 43 20 74 69 6d 65 20 7a 6f 6e 65 20 77   UTC time zone w
15d0: 69 74 68 0a 2e 51 57 20 22 5c 66 42 5c 2d 74 69  ith..QW "\fB\-ti
15e0: 6d 65 7a 6f 6e 65 5c 66 49 20 3a 55 54 43 5c 66  mezone\fI :UTC\f
15f0: 52 22 0a 6f 72 20 61 6e 79 20 6f 66 20 74 68 65  R".or any of the
1600: 20 65 71 75 69 76 61 6c 65 6e 74 20 77 61 79 73   equivalent ways
1610: 20 74 6f 20 73 70 65 63 69 66 79 20 69 74 2e 0a   to specify it..
1620: 2e 5c 22 20 4f 50 54 49 4f 4e 3a 20 2d 6c 6f 63  .\" OPTION: -loc
1630: 61 6c 65 0a 2e 54 50 0a 5c 66 42 5c 2d 6c 6f 63  ale..TP.\fB\-loc
1640: 61 6c 65 5c 66 52 20 6c 6f 63 61 6c 65 4e 61 6d  ale\fR localeNam
1650: 65 0a 2e 0a 53 70 65 63 69 66 69 65 73 20 74 68  e...Specifies th
1660: 61 74 20 6c 6f 63 61 6c 65 2d 64 65 70 65 6e 64  at locale-depend
1670: 65 6e 74 20 73 63 61 6e 6e 69 6e 67 20 61 6e 64  ent scanning and
1680: 20 66 6f 72 6d 61 74 74 69 6e 67 20 28 61 6e 64   formatting (and
1690: 20 64 61 74 65 20 61 72 69 74 68 6d 65 74 69 63   date arithmetic
16a0: 0a 66 6f 72 20 64 61 74 65 73 20 70 72 65 63 65  .for dates prece
16b0: 64 69 6e 67 20 74 68 65 20 61 64 6f 70 74 69 6f  ding the adoptio
16c0: 6e 20 6f 66 20 74 68 65 20 47 72 65 67 6f 72 69  n of the Gregori
16d0: 61 6e 20 63 61 6c 65 6e 64 61 72 29 20 69 73 20  an calendar) is 
16e0: 74 6f 20 62 65 20 64 6f 6e 65 20 69 6e 0a 74 68  to be done in.th
16f0: 65 20 6c 6f 63 61 6c 65 20 69 64 65 6e 74 69 66  e locale identif
1700: 69 65 64 20 62 79 20 5c 66 49 6c 6f 63 61 6c 65  ied by \fIlocale
1710: 4e 61 6d 65 5c 66 52 2e 20 20 54 68 65 20 6c 6f  Name\fR.  The lo
1720: 63 61 6c 65 20 6e 61 6d 65 20 6d 61 79 20 62 65  cale name may be
1730: 20 61 6e 79 20 6f 66 0a 74 68 65 20 6c 6f 63 61   any of.the loca
1740: 6c 65 73 20 61 63 63 65 70 74 61 62 6c 65 20 74  les acceptable t
1750: 6f 20 74 68 65 20 5c 66 42 6d 73 67 63 61 74 5c  o the \fBmsgcat\
1760: 66 52 20 70 61 63 6b 61 67 65 2c 20 6f 72 20 69  fR package, or i
1770: 74 20 6d 61 79 20 62 65 20 74 68 65 20 73 70 65  t may be the spe
1780: 63 69 61 6c 0a 6e 61 6d 65 20 5c 66 49 73 79 73  cial.name \fIsys
1790: 74 65 6d 5c 66 52 2c 20 77 68 69 63 68 20 72 65  tem\fR, which re
17a0: 70 72 65 73 65 6e 74 73 20 74 68 65 20 63 75 72  presents the cur
17b0: 72 65 6e 74 20 6c 6f 63 61 6c 65 20 6f 66 20 74  rent locale of t
17c0: 68 65 20 70 72 6f 63 65 73 73 2c 20 6f 72 0a 74  he process, or.t
17d0: 68 65 20 6e 75 6c 6c 20 73 74 72 69 6e 67 2c 20  he null string, 
17e0: 77 68 69 63 68 20 72 65 70 72 65 73 65 6e 74 73  which represents
17f0: 20 54 63 6c 27 73 20 64 65 66 61 75 6c 74 20 6c   Tcl's default l
1800: 6f 63 61 6c 65 2e 0a 2e 52 53 0a 2e 50 50 0a 54  ocale...RS..PP.T
1810: 68 65 20 65 66 66 65 63 74 20 6f 66 20 6c 6f 63  he effect of loc
1820: 61 6c 65 20 6f 6e 20 73 63 61 6e 6e 69 6e 67 20  ale on scanning 
1830: 61 6e 64 20 66 6f 72 6d 61 74 74 69 6e 67 20 69  and formatting i
1840: 73 20 64 69 73 63 75 73 73 65 64 20 69 6e 20 74  s discussed in t
1850: 68 65 0a 64 65 73 63 72 69 70 74 69 6f 6e 73 20  he.descriptions 
1860: 6f 66 20 74 68 65 20 69 6e 64 69 76 69 64 75 61  of the individua
1870: 6c 20 66 6f 72 6d 61 74 20 67 72 6f 75 70 73 20  l format groups 
1880: 75 6e 64 65 72 20 5c 66 42 46 4f 52 4d 41 54 20  under \fBFORMAT 
1890: 47 52 4f 55 50 53 5c 66 52 2e 0a 54 68 65 20 65  GROUPS\fR..The e
18a0: 66 66 65 63 74 20 6f 66 20 6c 6f 63 61 6c 65 20  ffect of locale 
18b0: 6f 6e 20 63 6c 6f 63 6b 20 61 72 69 74 68 6d 65  on clock arithme
18c0: 74 69 63 20 69 73 20 64 69 73 63 75 73 73 65 64  tic is discussed
18d0: 20 75 6e 64 65 72 0a 5c 66 42 43 4c 4f 43 4b 20   under.\fBCLOCK 
18e0: 41 52 49 54 48 4d 45 54 49 43 5c 66 52 2e 0a 2e  ARITHMETIC\fR...
18f0: 52 45 0a 2e 5c 22 20 4f 50 54 49 4f 4e 3a 20 2d  RE..\" OPTION: -
1900: 74 69 6d 65 7a 6f 6e 65 0a 2e 54 50 0a 5c 66 42  timezone..TP.\fB
1910: 5c 2d 74 69 6d 65 7a 6f 6e 65 5c 66 52 20 7a 6f  \-timezone\fR zo
1920: 6e 65 4e 61 6d 65 0a 2e 0a 53 70 65 63 69 66 69  neName...Specifi
1930: 65 73 20 74 68 61 74 20 63 6c 6f 63 6b 20 61 72  es that clock ar
1940: 69 74 68 6d 65 74 69 63 2c 20 66 6f 72 6d 61 74  ithmetic, format
1950: 74 69 6e 67 2c 20 61 6e 64 20 73 63 61 6e 6e 69  ting, and scanni
1960: 6e 67 20 61 72 65 20 74 6f 20 62 65 20 64 6f 6e  ng are to be don
1970: 65 0a 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 74  e.according to t
1980: 68 65 20 72 75 6c 65 73 20 66 6f 72 20 74 68 65  he rules for the
1990: 20 74 69 6d 65 20 7a 6f 6e 65 20 73 70 65 63 69   time zone speci
19a0: 66 69 65 64 20 62 79 20 5c 66 49 7a 6f 6e 65 4e  fied by \fIzoneN
19b0: 61 6d 65 5c 66 52 2e 0a 54 68 65 20 70 65 72 6d  ame\fR..The perm
19c0: 69 73 73 69 62 6c 65 20 76 61 6c 75 65 73 2c 20  issible values, 
19d0: 61 6e 64 20 74 68 65 69 72 20 69 6e 74 65 72 70  and their interp
19e0: 72 65 74 61 74 69 6f 6e 2c 20 61 72 65 20 64 69  retation, are di
19f0: 73 63 75 73 73 65 64 20 75 6e 64 65 72 0a 5c 66  scussed under.\f
1a00: 42 54 49 4d 45 20 5a 4f 4e 45 53 5c 66 52 2e 0a  BTIME ZONES\fR..
1a10: 4f 6e 20 73 75 62 63 6f 6d 6d 61 6e 64 73 20 74  On subcommands t
1a20: 68 61 74 20 65 78 70 65 63 74 20 61 20 5c 66 42  hat expect a \fB
1a30: 5c 2d 74 69 6d 65 7a 6f 6e 65 5c 66 52 20 61 72  \-timezone\fR ar
1a40: 67 75 6d 65 6e 74 2c 20 74 68 65 20 64 65 66 61  gument, the defa
1a50: 75 6c 74 0a 69 73 20 74 6f 20 75 73 65 20 74 68  ult.is to use th
1a60: 65 20 5c 66 49 63 75 72 72 65 6e 74 20 74 69 6d  e \fIcurrent tim
1a70: 65 20 7a 6f 6e 65 5c 66 52 2e 20 20 54 68 65 20  e zone\fR.  The 
1a80: 63 75 72 72 65 6e 74 20 74 69 6d 65 20 7a 6f 6e  current time zon
1a90: 65 20 69 73 0a 64 65 74 65 72 6d 69 6e 65 64 2c  e is.determined,
1aa0: 20 69 6e 20 6f 72 64 65 72 20 6f 66 20 70 72 65   in order of pre
1ab0: 66 65 72 65 6e 63 65 2c 20 62 79 3a 0a 2e 52 53  ference, by:..RS
1ac0: 0a 2e 49 50 20 5b 31 5d 0a 74 68 65 20 65 6e 76  ..IP [1].the env
1ad0: 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c  ironment variabl
1ae0: 65 20 5c 66 42 54 43 4c 5f 54 5a 5c 66 52 2e 0a  e \fBTCL_TZ\fR..
1af0: 2e 49 50 20 5b 32 5d 0a 74 68 65 20 65 6e 76 69  .IP [2].the envi
1b00: 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65  ronment variable
1b10: 20 5c 66 42 54 5a 5c 66 52 2e 0a 2e 49 50 20 5b   \fBTZ\fR...IP [
1b20: 33 5d 0a 6f 6e 20 57 69 6e 64 6f 77 73 20 73 79  3].on Windows sy
1b30: 73 74 65 6d 73 2c 20 74 68 65 20 74 69 6d 65 20  stems, the time 
1b40: 7a 6f 6e 65 20 73 65 74 74 69 6e 67 73 20 66 72  zone settings fr
1b50: 6f 6d 20 74 68 65 20 43 6f 6e 74 72 6f 6c 20 50  om the Control P
1b60: 61 6e 65 6c 2e 0a 2e 52 45 0a 2e 5c 22 20 4f 50  anel...RE..\" OP
1b70: 54 49 4f 4e 3a 20 2d 76 61 6c 69 64 61 74 65 0a  TION: -validate.
1b80: 2e 54 50 0a 5c 66 42 5c 2d 76 61 6c 69 64 61 74  .TP.\fB\-validat
1b90: 65 5c 66 52 20 62 6f 6f 6c 65 61 6e 0a 2e 0a 49  e\fR boolean...I
1ba0: 66 20 5c 66 49 62 6f 6f 6c 65 61 6e 5c 66 52 20  f \fIboolean\fR 
1bb0: 69 73 20 74 72 75 65 20 28 64 65 66 61 75 6c 74  is true (default
1bc0: 29 2c 20 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e  ), \fBclock scan
1bd0: 5c 66 52 20 77 69 6c 6c 20 72 61 69 73 65 20 61  \fR will raise a
1be0: 6e 20 65 72 72 6f 72 0a 69 66 20 74 68 65 20 69  n error.if the i
1bf0: 6e 70 75 74 20 63 6f 6e 74 61 69 6e 73 20 69 6e  nput contains in
1c00: 76 61 6c 69 64 20 76 61 6c 75 65 73 2c 20 65 2e  valid values, e.
1c10: 67 2e 20 64 61 79 20 6f 66 20 6d 6f 6e 74 68 20  g. day of month 
1c20: 67 72 65 61 74 65 72 20 74 68 61 6e 0a 6e 75 6d  greater than.num
1c30: 62 65 72 20 6f 66 20 64 61 79 73 20 69 6e 20 74  ber of days in t
1c40: 68 65 20 6d 6f 6e 74 68 2e 20 49 66 20 73 70 65  he month. If spe
1c50: 63 69 66 69 65 64 20 61 73 20 66 61 6c 73 65 2c  cified as false,
1c60: 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 6d 61 6b   the command mak
1c70: 65 73 0a 61 6e 20 61 64 6a 75 73 74 6d 65 6e 74  es.an adjustment
1c80: 20 74 6f 20 62 72 69 6e 67 20 76 61 6c 75 65 73   to bring values
1c90: 20 77 69 74 68 69 6e 20 61 63 63 65 70 74 61 62   within acceptab
1ca0: 6c 65 20 72 61 6e 67 65 2e 20 53 65 65 0a 5c 66  le range. See.\f
1cb0: 42 53 43 41 4e 4e 49 4e 47 20 54 49 4d 45 53 5c  BSCANNING TIMES\
1cc0: 66 54 20 66 6f 72 20 64 65 74 61 69 6c 73 2e 0a  fT for details..
1cd0: 2e 50 50 0a 49 66 20 6e 6f 6e 65 20 6f 66 20 74  .PP.If none of t
1ce0: 68 65 73 65 20 69 73 20 70 72 65 73 65 6e 74 2c  hese is present,
1cf0: 20 74 68 65 20 43 20 5c 66 42 6c 6f 63 61 6c 74   the C \fBlocalt
1d00: 69 6d 65 5c 66 52 20 61 6e 64 20 5c 66 42 6d 6b  ime\fR and \fBmk
1d10: 74 69 6d 65 5c 66 52 0a 66 75 6e 63 74 69 6f 6e  time\fR.function
1d20: 73 20 61 72 65 20 75 73 65 64 20 74 6f 20 61 74  s are used to at
1d30: 74 65 6d 70 74 20 74 6f 20 63 6f 6e 76 65 72 74  tempt to convert
1d40: 20 74 69 6d 65 73 20 62 65 74 77 65 65 6e 20 6c   times between l
1d50: 6f 63 61 6c 20 61 6e 64 0a 47 72 65 65 6e 77 69  ocal and.Greenwi
1d60: 63 68 2e 20 20 4f 6e 20 33 32 2d 62 69 74 20 73  ch.  On 32-bit s
1d70: 79 73 74 65 6d 73 2c 20 74 68 69 73 20 61 70 70  ystems, this app
1d80: 72 6f 61 63 68 20 69 73 20 6c 69 6b 65 6c 79 20  roach is likely 
1d90: 74 6f 20 68 61 76 65 20 62 75 67 73 2c 0a 70 61  to have bugs,.pa
1da0: 72 74 69 63 75 6c 61 72 6c 79 20 66 6f 72 20 74  rticularly for t
1db0: 69 6d 65 73 20 74 68 61 74 20 6c 69 65 20 6f 75  imes that lie ou
1dc0: 74 73 69 64 65 20 74 68 65 20 77 69 6e 64 6f 77  tside the window
1dd0: 20 28 61 70 70 72 6f 78 69 6d 61 74 65 6c 79 20   (approximately 
1de0: 74 68 65 0a 79 65 61 72 73 20 31 39 30 32 20 74  the.years 1902 t
1df0: 6f 20 32 30 33 37 29 20 74 68 61 74 20 63 61 6e  o 2037) that can
1e00: 20 62 65 20 72 65 70 72 65 73 65 6e 74 65 64 20   be represented 
1e10: 69 6e 20 61 20 33 32 2d 62 69 74 20 69 6e 74 65  in a 32-bit inte
1e20: 67 65 72 2e 0a 2e 53 48 20 22 43 4c 4f 43 4b 20  ger...SH "CLOCK 
1e30: 41 52 49 54 48 4d 45 54 49 43 22 0a 2e 50 50 0a  ARITHMETIC"..PP.
1e40: 54 68 65 20 5c 66 42 63 6c 6f 63 6b 20 61 64 64  The \fBclock add
1e50: 5c 66 52 20 63 6f 6d 6d 61 6e 64 20 70 65 72 66  \fR command perf
1e60: 6f 72 6d 73 20 63 6c 6f 63 6b 20 61 72 69 74 68  orms clock arith
1e70: 6d 65 74 69 63 20 6f 6e 20 61 20 76 61 6c 75 65  metic on a value
1e80: 0a 28 65 78 70 72 65 73 73 65 64 20 61 73 20 6e  .(expressed as n
1e90: 6f 6d 69 6e 61 6c 20 73 65 63 6f 6e 64 73 20 66  ominal seconds f
1ea0: 72 6f 6d 20 74 68 65 20 65 70 6f 63 68 20 74 69  rom the epoch ti
1eb0: 6d 65 20 6f 66 20 31 20 4a 61 6e 75 61 72 79 20  me of 1 January 
1ec0: 31 39 37 30 2c 20 30 30 3a 30 30 20 55 54 43 29  1970, 00:00 UTC)
1ed0: 0a 67 69 76 65 6e 20 61 73 20 69 74 73 20 66 69  .given as its fi
1ee0: 72 73 74 20 61 72 67 75 6d 65 6e 74 2e 20 20 54  rst argument.  T
1ef0: 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 61 72 67  he remaining arg
1f00: 75 6d 65 6e 74 73 20 28 6f 74 68 65 72 20 74 68  uments (other th
1f10: 61 6e 20 74 68 65 0a 70 6f 73 73 69 62 6c 65 20  an the.possible 
1f20: 5c 66 42 5c 2d 74 69 6d 65 7a 6f 6e 65 5c 66 52  \fB\-timezone\fR
1f30: 2c 20 5c 66 42 5c 2d 6c 6f 63 61 6c 65 5c 66 52  , \fB\-locale\fR
1f40: 20 61 6e 64 20 5c 66 42 5c 2d 67 6d 74 5c 66 52   and \fB\-gmt\fR
1f50: 20 6f 70 74 69 6f 6e 73 29 0a 61 72 65 20 69 6e   options).are in
1f60: 74 65 67 65 72 73 20 61 6e 64 20 6b 65 79 77 6f  tegers and keywo
1f70: 72 64 73 20 69 6e 20 61 6c 74 65 72 6e 61 74 69  rds in alternati
1f80: 6f 6e 2c 20 77 68 65 72 65 20 74 68 65 20 6b 65  on, where the ke
1f90: 79 77 6f 72 64 73 20 61 72 65 20 63 68 6f 73 65  ywords are chose
1fa0: 6e 0a 66 72 6f 6d 20 5c 66 42 73 65 63 6f 6e 64  n.from \fBsecond
1fb0: 73 5c 66 52 2c 20 5c 66 42 6d 69 6e 75 74 65 73  s\fR, \fBminutes
1fc0: 5c 66 52 2c 20 5c 66 42 68 6f 75 72 73 5c 66 52  \fR, \fBhours\fR
1fd0: 2c 0a 5c 66 42 64 61 79 73 5c 66 52 2c 20 5c 66  ,.\fBdays\fR, \f
1fe0: 42 77 65 65 6b 64 61 79 73 5c 66 52 2c 20 5c 66  Bweekdays\fR, \f
1ff0: 42 77 65 65 6b 73 5c 66 52 2c 20 5c 66 42 6d 6f  Bweeks\fR, \fBmo
2000: 6e 74 68 73 5c 66 52 2c 20 6f 72 20 5c 66 42 79  nths\fR, or \fBy
2010: 65 61 72 73 5c 66 52 2e 0a 2e 50 50 0a 41 64 64  ears\fR...PP.Add
2020: 69 74 69 6f 6e 20 6f 66 20 73 65 63 6f 6e 64 73  ition of seconds
2030: 2c 20 6d 69 6e 75 74 65 73 20 61 6e 64 20 68 6f  , minutes and ho
2040: 75 72 73 20 69 73 20 66 61 69 72 6c 79 20 73 74  urs is fairly st
2050: 72 61 69 67 68 74 66 6f 72 77 61 72 64 3b 0a 74  raightforward;.t
2060: 68 65 20 67 69 76 65 6e 20 74 69 6d 65 20 69 6e  he given time in
2070: 63 72 65 6d 65 6e 74 20 28 74 69 6d 65 73 20 73  crement (times s
2080: 69 78 74 79 20 66 6f 72 20 6d 69 6e 75 74 65 73  ixty for minutes
2090: 2c 20 6f 72 20 33 36 30 30 20 66 6f 72 20 68 6f  , or 3600 for ho
20a0: 75 72 73 29 0a 69 73 20 73 69 6d 70 6c 79 20 61  urs).is simply a
20b0: 64 64 65 64 20 74 6f 20 74 68 65 20 5c 66 49 74  dded to the \fIt
20c0: 69 6d 65 56 61 6c 5c 66 52 20 67 69 76 65 6e 0a  imeVal\fR given.
20d0: 74 6f 20 74 68 65 20 5c 66 42 63 6c 6f 63 6b 20  to the \fBclock 
20e0: 61 64 64 5c 66 52 20 63 6f 6d 6d 61 6e 64 2e 20  add\fR command. 
20f0: 20 54 68 65 20 72 65 73 75 6c 74 20 69 73 20 69   The result is i
2100: 6e 74 65 72 70 72 65 74 65 64 20 61 73 0a 61 20  nterpreted as.a 
2110: 6e 6f 6d 69 6e 61 6c 20 6e 75 6d 62 65 72 20 6f  nominal number o
2120: 66 20 73 65 63 6f 6e 64 73 20 66 72 6f 6d 20 74  f seconds from t
2130: 68 65 20 45 70 6f 63 68 2e 0a 2e 50 50 0a 53 75  he Epoch...PP.Su
2140: 72 70 72 69 73 69 6e 67 20 72 65 73 75 6c 74 73  rprising results
2150: 0a 6d 61 79 20 62 65 20 6f 62 74 61 69 6e 65 64  .may be obtained
2160: 20 77 68 65 6e 20 63 72 6f 73 73 69 6e 67 20 61   when crossing a
2170: 20 70 6f 69 6e 74 20 61 74 20 77 68 69 63 68 20   point at which 
2180: 61 20 6c 65 61 70 20 73 65 63 6f 6e 64 20 69 73  a leap second is
2190: 0a 69 6e 73 65 72 74 65 64 20 6f 72 20 72 65 6d  .inserted or rem
21a0: 6f 76 65 64 3b 20 74 68 65 20 5c 66 42 63 6c 6f  oved; the \fBclo
21b0: 63 6b 20 61 64 64 5c 66 52 20 63 6f 6d 6d 61 6e  ck add\fR comman
21c0: 64 20 73 69 6d 70 6c 79 20 69 67 6e 6f 72 65 73  d simply ignores
21d0: 0a 6c 65 61 70 20 73 65 63 6f 6e 64 73 20 61 6e  .leap seconds an
21e0: 64 20 74 68 65 72 65 66 6f 72 65 20 61 73 73 75  d therefore assu
21f0: 6d 65 73 20 74 68 61 74 20 74 69 6d 65 73 20 63  mes that times c
2200: 6f 6d 65 20 69 6e 20 73 65 71 75 65 6e 63 65 2c  ome in sequence,
2210: 0a 32 33 3a 35 39 3a 35 38 2c 20 32 33 3a 35 39  .23:59:58, 23:59
2220: 3a 35 39 2c 20 30 30 3a 30 30 3a 30 30 2e 20 20  :59, 00:00:00.  
2230: 54 68 69 73 20 61 73 73 75 6d 70 74 69 6f 6e 20  This assumption 
2240: 69 73 20 68 61 6e 64 6c 65 64 20 62 79 0a 74 68  is handled by.th
2250: 65 20 66 61 63 74 20 74 68 61 74 20 54 63 6c 27  e fact that Tcl'
2260: 73 20 6d 6f 64 65 6c 20 6f 66 20 74 69 6d 65 20  s model of time 
2270: 72 65 61 63 74 73 20 74 6f 20 6c 65 61 70 20 73  reacts to leap s
2280: 65 63 6f 6e 64 73 20 62 79 20 73 70 65 65 64 69  econds by speedi
2290: 6e 67 0a 6f 72 20 73 6c 6f 77 69 6e 67 20 74 68  ng.or slowing th
22a0: 65 20 63 6c 6f 63 6b 20 62 79 20 61 20 6d 69 6e  e clock by a min
22b0: 69 73 63 75 6c 65 20 61 6d 6f 75 6e 74 20 75 6e  iscule amount un
22c0: 74 69 6c 20 54 63 6c 27 73 20 74 69 6d 65 0a 69  til Tcl's time.i
22d0: 73 20 62 61 63 6b 20 69 6e 20 73 74 65 70 20 77  s back in step w
22e0: 69 74 68 20 74 68 65 20 77 6f 72 6c 64 2e 0a 2e  ith the world...
22f0: 50 50 0a 54 68 65 20 66 61 63 74 20 74 68 61 74  PP.The fact that
2300: 20 61 64 64 69 6e 67 20 61 6e 64 20 73 75 62 74   adding and subt
2310: 72 61 63 74 69 6e 67 20 68 6f 75 72 73 20 69 73  racting hours is
2320: 20 64 65 66 69 6e 65 64 20 69 6e 20 74 65 72 6d   defined in term
2330: 73 20 6f 66 0a 61 62 73 6f 6c 75 74 65 20 74 69  s of.absolute ti
2340: 6d 65 20 6d 65 61 6e 73 20 74 68 61 74 20 69 74  me means that it
2350: 20 77 69 6c 6c 20 61 64 64 20 66 69 78 65 64 20   will add fixed 
2360: 61 6d 6f 75 6e 74 73 20 6f 66 20 74 69 6d 65 20  amounts of time 
2370: 69 6e 20 74 69 6d 65 20 7a 6f 6e 65 73 0a 74 68  in time zones.th
2380: 61 74 20 6f 62 73 65 72 76 65 20 73 75 6d 6d 65  at observe summe
2390: 72 20 74 69 6d 65 20 28 44 61 79 6c 69 67 68 74  r time (Daylight
23a0: 20 53 61 76 69 6e 67 20 54 69 6d 65 29 2e 20 20   Saving Time).  
23b0: 46 6f 72 20 65 78 61 6d 70 6c 65 2c 0a 74 68 65  For example,.the
23c0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 64 65 20   following code 
23d0: 73 65 74 73 20 74 68 65 20 76 61 6c 75 65 20 6f  sets the value o
23e0: 66 20 5c 66 42 78 5c 66 52 20 74 6f 20 5c 66 42  f \fBx\fR to \fB
23f0: 30 34 3a 30 30 3a 30 30 5c 66 52 20 62 65 63 61  04:00:00\fR beca
2400: 75 73 65 0a 74 68 65 20 63 6c 6f 63 6b 20 68 61  use.the clock ha
2410: 73 20 63 68 61 6e 67 65 64 20 69 6e 20 74 68 65  s changed in the
2420: 20 69 6e 74 65 72 76 61 6c 20 69 6e 20 71 75 65   interval in que
2430: 73 74 69 6f 6e 2e 0a 2e 50 50 0a 2e 43 53 0a 73  stion...PP..CS.s
2440: 65 74 20 73 20 5b 5c 66 42 63 6c 6f 63 6b 20 73  et s [\fBclock s
2450: 63 61 6e 5c 66 52 20 7b 32 30 30 34 2d 31 30 2d  can\fR {2004-10-
2460: 33 30 20 30 35 3a 30 30 3a 30 30 7d 20 5c 65 0a  30 05:00:00} \e.
2470: 20 20 20 20 20 20 20 20 20 20 20 2d 66 6f 72 6d             -form
2480: 61 74 20 7b 25 59 2d 25 6d 2d 25 64 20 25 48 3a  at {%Y-%m-%d %H:
2490: 25 4d 3a 25 53 7d 20 5c 65 0a 20 20 20 20 20 20  %M:%S} \e.      
24a0: 20 20 20 20 20 2d 74 69 6d 65 7a 6f 6e 65 20 3a       -timezone :
24b0: 41 6d 65 72 69 63 61 2f 4e 65 77 5f 59 6f 72 6b  America/New_York
24c0: 5d 0a 73 65 74 20 61 20 5b 5c 66 42 63 6c 6f 63  ].set a [\fBcloc
24d0: 6b 20 61 64 64 5c 66 52 20 24 73 20 32 34 20 68  k add\fR $s 24 h
24e0: 6f 75 72 73 20 2d 74 69 6d 65 7a 6f 6e 65 20 3a  ours -timezone :
24f0: 41 6d 65 72 69 63 61 2f 4e 65 77 5f 59 6f 72 6b  America/New_York
2500: 5d 0a 73 65 74 20 78 20 5b 5c 66 42 63 6c 6f 63  ].set x [\fBcloc
2510: 6b 20 66 6f 72 6d 61 74 5c 66 52 20 24 61 20 5c  k format\fR $a \
2520: 65 0a 20 20 20 20 20 20 20 20 20 20 20 2d 66 6f  e.           -fo
2530: 72 6d 61 74 20 7b 25 48 3a 25 4d 3a 25 53 7d 20  rmat {%H:%M:%S} 
2540: 2d 74 69 6d 65 7a 6f 6e 65 20 3a 41 6d 65 72 69  -timezone :Ameri
2550: 63 61 2f 4e 65 77 5f 59 6f 72 6b 5d 0a 2e 43 45  ca/New_York]..CE
2560: 0a 2e 50 50 0a 41 64 64 69 6e 67 20 61 6e 64 20  ..PP.Adding and 
2570: 73 75 62 74 72 61 63 74 69 6e 67 20 64 61 79 73  subtracting days
2580: 20 61 6e 64 20 77 65 65 6b 73 20 69 73 20 61 63   and weeks is ac
2590: 63 6f 6d 70 6c 69 73 68 65 64 20 62 79 20 63 6f  complished by co
25a0: 6e 76 65 72 74 69 6e 67 0a 74 68 65 20 67 69 76  nverting.the giv
25b0: 65 6e 20 74 69 6d 65 20 74 6f 20 61 20 63 61 6c  en time to a cal
25c0: 65 6e 64 61 72 20 64 61 79 20 61 6e 64 20 74 69  endar day and ti
25d0: 6d 65 20 6f 66 20 64 61 79 20 69 6e 20 74 68 65  me of day in the
25e0: 20 61 70 70 72 6f 70 72 69 61 74 65 0a 74 69 6d   appropriate.tim
25f0: 65 20 7a 6f 6e 65 20 61 6e 64 20 6c 6f 63 61 6c  e zone and local
2600: 65 2e 20 20 54 68 65 20 72 65 71 75 69 73 69 74  e.  The requisit
2610: 65 20 6e 75 6d 62 65 72 20 6f 66 20 64 61 79 73  e number of days
2620: 20 28 77 65 65 6b 73 20 61 72 65 20 63 6f 6e 76   (weeks are conv
2630: 65 72 74 65 64 0a 74 6f 20 64 61 79 73 20 62 79  erted.to days by
2640: 20 6d 75 6c 74 69 70 6c 79 69 6e 67 20 62 79 20   multiplying by 
2650: 73 65 76 65 6e 29 20 69 73 20 61 64 64 65 64 20  seven) is added 
2660: 74 6f 20 74 68 65 20 63 61 6c 65 6e 64 61 72 20  to the calendar 
2670: 64 61 79 2c 20 61 6e 64 0a 74 68 65 20 64 61 74  day, and.the dat
2680: 65 20 61 6e 64 20 74 69 6d 65 20 61 72 65 20 74  e and time are t
2690: 68 65 6e 20 63 6f 6e 76 65 72 74 65 64 20 62 61  hen converted ba
26a0: 63 6b 20 74 6f 20 61 20 63 6f 75 6e 74 20 6f 66  ck to a count of
26b0: 20 73 65 63 6f 6e 64 73 20 66 72 6f 6d 0a 74 68   seconds from.th
26c0: 65 20 65 70 6f 63 68 20 74 69 6d 65 2e 20 20 54  e epoch time.  T
26d0: 68 65 20 5c 66 42 77 65 65 6b 64 61 79 73 5c 66  he \fBweekdays\f
26e0: 52 20 6b 65 79 77 6f 72 64 20 69 73 20 73 69 6d  R keyword is sim
26f0: 69 6c 61 72 20 74 6f 20 5c 66 42 64 61 79 73 5c  ilar to \fBdays\
2700: 66 52 2c 0a 77 69 74 68 20 74 68 65 20 6f 6e 6c  fR,.with the onl
2710: 79 20 64 69 66 66 65 72 65 6e 63 65 20 74 68 61  y difference tha
2720: 74 20 77 65 65 6b 65 6e 64 73 20 2d 20 53 61 74  t weekends - Sat
2730: 75 72 64 61 79 73 20 61 6e 64 20 53 75 6e 64 61  urdays and Sunda
2740: 79 73 20 2d 20 61 72 65 20 73 6b 69 70 70 65 64  ys - are skipped
2750: 2e 0a 2e 50 50 0a 41 64 64 69 6e 67 20 61 6e 64  ...PP.Adding and
2760: 20 73 75 62 74 72 61 63 74 69 6e 67 20 61 20 67   subtracting a g
2770: 69 76 65 6e 20 6e 75 6d 62 65 72 20 6f 66 20 64  iven number of d
2780: 61 79 73 20 61 63 72 6f 73 73 20 74 68 65 20 70  ays across the p
2790: 6f 69 6e 74 20 74 68 61 74 0a 74 68 65 20 74 69  oint that.the ti
27a0: 6d 65 20 63 68 61 6e 67 65 73 20 61 74 20 74 68  me changes at th
27b0: 65 20 73 74 61 72 74 20 6f 72 20 65 6e 64 20 6f  e start or end o
27c0: 66 20 73 75 6d 6d 65 72 20 74 69 6d 65 20 28 44  f summer time (D
27d0: 61 79 6c 69 67 68 74 20 53 61 76 69 6e 67 20 54  aylight Saving T
27e0: 69 6d 65 29 0a 72 65 73 75 6c 74 73 20 69 6e 20  ime).results in 
27f0: 74 68 65 20 5c 66 49 73 61 6d 65 20 6c 6f 63 61  the \fIsame loca
2800: 6c 20 74 69 6d 65 5c 66 52 20 6f 6e 20 74 68 65  l time\fR on the
2810: 20 64 61 79 20 69 6e 20 71 75 65 73 74 69 6f 6e   day in question
2820: 2e 20 20 46 6f 72 0a 69 6e 73 74 61 6e 63 65 2c  .  For.instance,
2830: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63   the following c
2840: 6f 64 65 20 73 65 74 73 20 74 68 65 20 76 61 6c  ode sets the val
2850: 75 65 20 6f 66 20 5c 66 42 78 5c 66 52 20 74 6f  ue of \fBx\fR to
2860: 20 5c 66 42 30 35 3a 30 30 3a 30 30 5c 66 52 2e   \fB05:00:00\fR.
2870: 0a 2e 50 50 0a 2e 43 53 0a 73 65 74 20 73 20 5b  ..PP..CS.set s [
2880: 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e 5c 66 52  \fBclock scan\fR
2890: 20 7b 32 30 30 34 2d 31 30 2d 33 30 20 30 35 3a   {2004-10-30 05:
28a0: 30 30 3a 30 30 7d 20 5c 65 0a 20 20 20 20 20 20  00:00} \e.      
28b0: 20 20 20 20 20 2d 66 6f 72 6d 61 74 20 7b 25 59       -format {%Y
28c0: 2d 25 6d 2d 25 64 20 25 48 3a 25 4d 3a 25 53 7d  -%m-%d %H:%M:%S}
28d0: 20 5c 65 0a 20 20 20 20 20 20 20 20 20 20 20 2d   \e.           -
28e0: 74 69 6d 65 7a 6f 6e 65 20 3a 41 6d 65 72 69 63  timezone :Americ
28f0: 61 2f 4e 65 77 5f 59 6f 72 6b 5d 0a 73 65 74 20  a/New_York].set 
2900: 61 20 5b 5c 66 42 63 6c 6f 63 6b 20 61 64 64 5c  a [\fBclock add\
2910: 66 52 20 24 73 20 31 20 64 61 79 20 2d 74 69 6d  fR $s 1 day -tim
2920: 65 7a 6f 6e 65 20 3a 41 6d 65 72 69 63 61 2f 4e  ezone :America/N
2930: 65 77 5f 59 6f 72 6b 5d 0a 73 65 74 20 78 20 5b  ew_York].set x [
2940: 5c 66 42 63 6c 6f 63 6b 20 66 6f 72 6d 61 74 5c  \fBclock format\
2950: 66 52 20 24 61 20 5c 65 0a 20 20 20 20 20 20 20  fR $a \e.       
2960: 20 20 20 20 2d 66 6f 72 6d 61 74 20 7b 25 48 3a      -format {%H:
2970: 25 4d 3a 25 53 7d 20 2d 74 69 6d 65 7a 6f 6e 65  %M:%S} -timezone
2980: 20 3a 41 6d 65 72 69 63 61 2f 4e 65 77 5f 59 6f   :America/New_Yo
2990: 72 6b 5d 0a 2e 43 45 0a 2e 50 50 0a 49 6e 20 63  rk]..CE..PP.In c
29a0: 61 73 65 73 20 6f 66 20 61 6d 62 69 67 75 69 74  ases of ambiguit
29b0: 79 2c 20 77 68 65 72 65 20 74 68 65 20 73 61 6d  y, where the sam
29c0: 65 20 6c 6f 63 61 6c 20 74 69 6d 65 20 68 61 70  e local time hap
29d0: 70 65 6e 73 20 74 77 69 63 65 0a 6f 6e 20 74 68  pens twice.on th
29e0: 65 20 73 61 6d 65 20 64 61 79 2c 20 74 68 65 20  e same day, the 
29f0: 65 61 72 6c 69 65 72 20 74 69 6d 65 20 69 73 20  earlier time is 
2a00: 75 73 65 64 2e 20 20 49 6e 20 63 61 73 65 73 20  used.  In cases 
2a10: 77 68 65 72 65 20 74 68 65 20 63 6f 6e 76 65 72  where the conver
2a20: 73 69 6f 6e 0a 79 69 65 6c 64 73 20 61 6e 20 69  sion.yields an i
2a30: 6d 70 6f 73 73 69 62 6c 65 20 74 69 6d 65 20 28  mpossible time (
2a40: 66 6f 72 20 69 6e 73 74 61 6e 63 65 2c 20 30 32  for instance, 02
2a50: 3a 33 30 20 64 75 72 69 6e 67 20 74 68 65 20 53  :30 during the S
2a60: 70 72 69 6e 67 0a 44 61 79 6c 69 67 68 74 20 53  pring.Daylight S
2a70: 61 76 69 6e 67 20 54 69 6d 65 20 63 68 61 6e 67  aving Time chang
2a80: 65 20 75 73 69 6e 67 20 55 53 20 72 75 6c 65 73  e using US rules
2a90: 29 2c 20 74 68 65 20 74 69 6d 65 20 69 73 20 63  ), the time is c
2aa0: 6f 6e 76 65 72 74 65 64 0a 61 73 20 69 66 20 74  onverted.as if t
2ab0: 68 65 20 63 6c 6f 63 6b 20 68 61 64 20 6e 6f 74  he clock had not
2ac0: 20 63 68 61 6e 67 65 64 2e 20 20 54 68 75 73 2c   changed.  Thus,
2ad0: 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63   the following c
2ae0: 6f 64 65 0a 77 69 6c 6c 20 73 65 74 20 74 68 65  ode.will set the
2af0: 20 76 61 6c 75 65 20 6f 66 20 5c 66 42 78 5c 66   value of \fBx\f
2b00: 52 20 74 6f 20 5c 66 42 30 33 3a 33 30 3a 30 30  R to \fB03:30:00
2b10: 5c 66 52 2e 0a 2e 50 50 0a 2e 43 53 0a 73 65 74  \fR...PP..CS.set
2b20: 20 73 20 5b 5c 66 42 63 6c 6f 63 6b 20 73 63 61   s [\fBclock sca
2b30: 6e 5c 66 52 20 7b 32 30 30 34 2d 30 34 2d 30 33  n\fR {2004-04-03
2b40: 20 30 32 3a 33 30 3a 30 30 7d 20 5c 65 0a 20 20   02:30:00} \e.  
2b50: 20 20 20 20 20 20 20 20 20 2d 66 6f 72 6d 61 74           -format
2b60: 20 7b 25 59 2d 25 6d 2d 25 64 20 25 48 3a 25 4d   {%Y-%m-%d %H:%M
2b70: 3a 25 53 7d 20 5c 65 0a 20 20 20 20 20 20 20 20  :%S} \e.        
2b80: 20 20 20 2d 74 69 6d 65 7a 6f 6e 65 20 3a 41 6d     -timezone :Am
2b90: 65 72 69 63 61 2f 4e 65 77 5f 59 6f 72 6b 5d 0a  erica/New_York].
2ba0: 73 65 74 20 61 20 5b 5c 66 42 63 6c 6f 63 6b 20  set a [\fBclock 
2bb0: 61 64 64 5c 66 52 20 24 73 20 31 20 64 61 79 20  add\fR $s 1 day 
2bc0: 2d 74 69 6d 65 7a 6f 6e 65 20 3a 41 6d 65 72 69  -timezone :Ameri
2bd0: 63 61 2f 4e 65 77 5f 59 6f 72 6b 5d 0a 73 65 74  ca/New_York].set
2be0: 20 78 20 5b 5c 66 42 63 6c 6f 63 6b 20 66 6f 72   x [\fBclock for
2bf0: 6d 61 74 5c 66 52 20 24 61 20 5c 65 0a 20 20 20  mat\fR $a \e.   
2c00: 20 20 20 20 20 20 20 20 2d 66 6f 72 6d 61 74 20          -format 
2c10: 7b 25 48 3a 25 4d 3a 25 53 7d 20 2d 74 69 6d 65  {%H:%M:%S} -time
2c20: 7a 6f 6e 65 20 3a 41 6d 65 72 69 63 61 2f 4e 65  zone :America/Ne
2c30: 77 5f 59 6f 72 6b 5d 0a 2e 43 45 0a 2e 50 50 0a  w_York]..CE..PP.
2c40: 41 64 64 69 6e 67 20 61 20 67 69 76 65 6e 20 6e  Adding a given n
2c50: 75 6d 62 65 72 20 6f 66 20 64 61 79 73 20 6f 72  umber of days or
2c60: 20 77 65 65 6b 73 20 77 6f 72 6b 73 20 63 6f 72   weeks works cor
2c70: 72 65 63 74 6c 79 20 61 63 72 6f 73 73 20 74 68  rectly across th
2c80: 65 20 63 6f 6e 76 65 72 73 69 6f 6e 0a 62 65 74  e conversion.bet
2c90: 77 65 65 6e 20 74 68 65 20 4a 75 6c 69 61 6e 20  ween the Julian 
2ca0: 61 6e 64 20 47 72 65 67 6f 72 69 61 6e 20 63 61  and Gregorian ca
2cb0: 6c 65 6e 64 61 72 73 3b 20 74 68 65 20 6f 6d 69  lendars; the omi
2cc0: 74 74 65 64 20 64 61 79 73 20 61 72 65 20 73 6b  tted days are sk
2cd0: 69 70 70 65 64 2e 0a 54 68 65 20 66 6f 6c 6c 6f  ipped..The follo
2ce0: 77 69 6e 67 20 63 6f 64 65 20 73 65 74 73 20 5c  wing code sets \
2cf0: 66 42 7a 5c 66 52 20 74 6f 20 5c 66 42 31 37 35  fBz\fR to \fB175
2d00: 32 2d 30 39 2d 31 34 5c 66 52 2e 0a 2e 50 50 0a  2-09-14\fR...PP.
2d10: 2e 43 53 0a 73 65 74 20 78 20 5b 5c 66 42 63 6c  .CS.set x [\fBcl
2d20: 6f 63 6b 20 73 63 61 6e 5c 66 52 20 31 37 35 32  ock scan\fR 1752
2d30: 2d 30 39 2d 30 32 20 2d 66 6f 72 6d 61 74 20 25  -09-02 -format %
2d40: 59 2d 25 6d 2d 25 64 20 2d 6c 6f 63 61 6c 65 20  Y-%m-%d -locale 
2d50: 65 6e 5f 55 53 5d 0a 73 65 74 20 79 20 5b 5c 66  en_US].set y [\f
2d60: 42 63 6c 6f 63 6b 20 61 64 64 5c 66 52 20 24 78  Bclock add\fR $x
2d70: 20 31 20 64 61 79 20 2d 6c 6f 63 61 6c 65 20 65   1 day -locale e
2d80: 6e 5f 55 53 5d 0a 73 65 74 20 7a 20 5b 5c 66 42  n_US].set z [\fB
2d90: 63 6c 6f 63 6b 20 66 6f 72 6d 61 74 5c 66 52 20  clock format\fR 
2da0: 24 79 20 2d 66 6f 72 6d 61 74 20 25 59 2d 25 6d  $y -format %Y-%m
2db0: 2d 25 64 20 2d 6c 6f 63 61 6c 65 20 65 6e 5f 55  -%d -locale en_U
2dc0: 53 5d 0a 2e 43 45 0a 2e 50 50 0a 49 6e 20 74 68  S]..CE..PP.In th
2dd0: 65 20 62 69 7a 61 72 72 65 20 63 61 73 65 20 74  e bizarre case t
2de0: 68 61 74 20 61 64 64 69 6e 67 20 74 68 65 20 67  hat adding the g
2df0: 69 76 65 6e 20 6e 75 6d 62 65 72 20 6f 66 20 64  iven number of d
2e00: 61 79 73 20 79 69 65 6c 64 73 20 61 20 64 61 74  ays yields a dat
2e10: 65 0a 74 68 61 74 20 64 6f 65 73 20 6e 6f 74 20  e.that does not 
2e20: 65 78 69 73 74 20 62 65 63 61 75 73 65 20 69 74  exist because it
2e30: 20 66 61 6c 6c 73 20 77 69 74 68 69 6e 20 74 68   falls within th
2e40: 65 20 64 72 6f 70 70 65 64 20 64 61 79 73 20 6f  e dropped days o
2e50: 66 20 74 68 65 0a 4a 75 6c 69 61 6e 2d 74 6f 2d  f the.Julian-to-
2e60: 47 72 65 67 6f 72 69 61 6e 20 63 6f 6e 76 65 72  Gregorian conver
2e70: 73 69 6f 6e 2c 20 74 68 65 20 64 61 74 65 20 69  sion, the date i
2e80: 73 20 63 6f 6e 76 65 72 74 65 64 20 61 73 20 69  s converted as i
2e90: 66 20 69 74 20 77 61 73 0a 6f 6e 20 74 68 65 20  f it was.on the 
2ea0: 4a 75 6c 69 61 6e 20 63 61 6c 65 6e 64 61 72 2e  Julian calendar.
2eb0: 0a 2e 50 50 0a 41 64 64 69 6e 67 20 61 20 6e 75  ..PP.Adding a nu
2ec0: 6d 62 65 72 20 6f 66 20 6d 6f 6e 74 68 73 2c 20  mber of months, 
2ed0: 6f 72 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 79  or a number of y
2ee0: 65 61 72 73 2c 20 69 73 20 73 69 6d 69 6c 61 72  ears, is similar
2ef0: 3b 20 69 74 0a 63 6f 6e 76 65 72 74 73 20 74 68  ; it.converts th
2f00: 65 20 67 69 76 65 6e 20 74 69 6d 65 20 74 6f 20  e given time to 
2f10: 61 20 63 61 6c 65 6e 64 61 72 20 64 61 74 65 20  a calendar date 
2f20: 61 6e 64 20 74 69 6d 65 20 6f 66 20 64 61 79 2e  and time of day.
2f30: 20 20 49 74 20 74 68 65 6e 0a 61 64 64 73 20 74    It then.adds t
2f40: 68 65 20 72 65 71 75 69 73 69 74 65 20 6e 75 6d  he requisite num
2f50: 62 65 72 20 6f 66 20 6d 6f 6e 74 68 73 20 6f 72  ber of months or
2f60: 20 79 65 61 72 73 2c 20 61 6e 64 20 72 65 63 6f   years, and reco
2f70: 6e 76 65 72 74 73 20 74 68 65 20 72 65 73 75 6c  nverts the resul
2f80: 74 69 6e 67 0a 64 61 74 65 20 61 6e 64 20 74 69  ting.date and ti
2f90: 6d 65 20 6f 66 20 64 61 79 20 74 6f 20 61 6e 20  me of day to an 
2fa0: 61 62 73 6f 6c 75 74 65 20 74 69 6d 65 2e 0a 2e  absolute time...
2fb0: 50 50 0a 49 66 20 74 68 65 20 72 65 73 75 6c 74  PP.If the result
2fc0: 69 6e 67 20 64 61 74 65 20 69 73 20 69 6d 70 6f  ing date is impo
2fd0: 73 73 69 62 6c 65 20 62 65 63 61 75 73 65 20 74  ssible because t
2fe0: 68 65 20 6d 6f 6e 74 68 20 68 61 73 20 74 6f 6f  he month has too
2ff0: 20 66 65 77 20 64 61 79 73 0a 28 66 6f 72 20 65   few days.(for e
3000: 78 61 6d 70 6c 65 2c 20 77 68 65 6e 20 61 64 64  xample, when add
3010: 69 6e 67 20 31 20 6d 6f 6e 74 68 20 74 6f 20 33  ing 1 month to 3
3020: 31 20 4a 61 6e 75 61 72 79 29 2c 20 74 68 65 20  1 January), the 
3030: 6c 61 73 74 20 64 61 79 20 6f 66 20 74 68 65 0a  last day of the.
3040: 6d 6f 6e 74 68 20 69 73 20 73 75 62 73 74 69 74  month is substit
3050: 75 74 65 64 2e 20 20 54 68 75 73 2c 20 61 64 64  uted.  Thus, add
3060: 69 6e 67 20 31 20 6d 6f 6e 74 68 20 74 6f 20 33  ing 1 month to 3
3070: 31 20 4a 61 6e 75 61 72 79 20 77 69 6c 6c 20 72  1 January will r
3080: 65 73 75 6c 74 20 69 6e 0a 32 38 20 46 65 62 72  esult in.28 Febr
3090: 75 61 72 79 20 69 6e 20 61 20 63 6f 6d 6d 6f 6e  uary in a common
30a0: 20 79 65 61 72 20 6f 72 20 32 39 20 46 65 62 72   year or 29 Febr
30b0: 75 61 72 79 20 69 6e 20 61 20 6c 65 61 70 20 79  uary in a leap y
30c0: 65 61 72 2e 0a 2e 50 50 0a 54 68 65 20 72 75 6c  ear...PP.The rul
30d0: 65 73 20 66 6f 72 20 68 61 6e 64 6c 69 6e 67 20  es for handling 
30e0: 61 6e 6f 6d 61 6c 69 65 73 20 72 65 6c 61 74 69  anomalies relati
30f0: 6e 67 20 74 6f 20 73 75 6d 6d 65 72 20 74 69 6d  ng to summer tim
3100: 65 20 61 6e 64 20 74 6f 20 74 68 65 0a 47 72 65  e and to the.Gre
3110: 67 6f 72 69 61 6e 20 63 61 6c 65 6e 64 61 72 20  gorian calendar 
3120: 61 72 65 20 74 68 65 20 73 61 6d 65 20 77 68 65  are the same whe
3130: 6e 20 61 64 64 69 6e 67 2f 73 75 62 74 72 61 63  n adding/subtrac
3140: 74 69 6e 67 20 6d 6f 6e 74 68 73 20 61 6e 64 0a  ting months and.
3150: 79 65 61 72 73 20 61 73 20 74 68 65 79 20 61 72  years as they ar
3160: 65 20 77 68 65 6e 20 61 64 64 69 6e 67 2f 73 75  e when adding/su
3170: 62 74 72 61 63 74 69 6e 67 20 64 61 79 73 20 61  btracting days a
3180: 6e 64 20 77 65 65 6b 73 2e 0a 2e 50 50 0a 49 66  nd weeks...PP.If
3190: 20 6d 75 6c 74 69 70 6c 65 20 5c 66 49 63 6f 75   multiple \fIcou
31a0: 6e 74 20 75 6e 69 74 5c 66 52 20 70 61 69 72 73  nt unit\fR pairs
31b0: 20 61 72 65 20 70 72 65 73 65 6e 74 20 6f 6e 20   are present on 
31c0: 74 68 65 20 63 6f 6d 6d 61 6e 64 2c 20 74 68 65  the command, the
31d0: 79 0a 61 72 65 20 65 76 61 6c 75 61 74 65 64 20  y.are evaluated 
31e0: 63 6f 6e 73 65 63 75 74 69 76 65 6c 79 2c 20 66  consecutively, f
31f0: 72 6f 6d 20 6c 65 66 74 20 74 6f 20 72 69 67 68  rom left to righ
3200: 74 2e 0a 2e 53 48 20 22 48 49 47 48 20 52 45 53  t...SH "HIGH RES
3210: 4f 4c 55 54 49 4f 4e 20 54 49 4d 45 52 53 22 0a  OLUTION TIMERS".
3220: 2e 50 50 0a 4d 6f 73 74 20 6f 66 20 74 68 65 20  .PP.Most of the 
3230: 73 75 62 63 6f 6d 6d 61 6e 64 73 20 73 75 70 70  subcommands supp
3240: 6f 72 74 65 64 20 62 79 20 74 68 65 20 5c 66 42  orted by the \fB
3250: 63 6c 6f 63 6b 5c 66 52 20 63 6f 6d 6d 61 6e 64  clock\fR command
3260: 20 64 65 61 6c 20 77 69 74 68 0a 74 69 6d 65 73   deal with.times
3270: 20 72 65 70 72 65 73 65 6e 74 65 64 20 61 73 20   represented as 
3280: 61 20 63 6f 75 6e 74 20 6f 66 20 73 65 63 6f 6e  a count of secon
3290: 64 73 20 66 72 6f 6d 20 74 68 65 20 65 70 6f 63  ds from the epoc
32a0: 68 20 74 69 6d 65 2c 20 61 6e 64 20 74 68 69 73  h time, and this
32b0: 20 69 73 20 74 68 65 0a 72 65 70 72 65 73 65 6e   is the.represen
32c0: 74 61 74 69 6f 6e 20 74 68 61 74 20 5c 66 42 63  tation that \fBc
32d0: 6c 6f 63 6b 20 73 65 63 6f 6e 64 73 5c 66 52 20  lock seconds\fR 
32e0: 72 65 74 75 72 6e 73 2e 20 20 54 68 65 72 65 20  returns.  There 
32f0: 61 72 65 20 74 68 72 65 65 20 65 78 63 65 70 74  are three except
3300: 69 6f 6e 73 2c 0a 77 68 69 63 68 20 61 72 65 20  ions,.which are 
3310: 61 6c 6c 20 69 6e 74 65 6e 64 65 64 20 66 6f 72  all intended for
3320: 20 75 73 65 20 77 68 65 72 65 20 68 69 67 68 65   use where highe
3330: 72 2d 72 65 73 6f 6c 75 74 69 6f 6e 20 74 69 6d  r-resolution tim
3340: 65 73 20 61 72 65 20 72 65 71 75 69 72 65 64 2e  es are required.
3350: 0a 5c 66 42 63 6c 6f 63 6b 20 6d 69 6c 6c 69 73  .\fBclock millis
3360: 65 63 6f 6e 64 73 5c 66 52 20 72 65 74 75 72 6e  econds\fR return
3370: 73 20 74 68 65 20 63 6f 75 6e 74 20 6f 66 20 6d  s the count of m
3380: 69 6c 6c 69 73 65 63 6f 6e 64 73 20 66 72 6f 6d  illiseconds from
3390: 20 74 68 65 0a 65 70 6f 63 68 20 74 69 6d 65 2c   the.epoch time,
33a0: 20 61 6e 64 20 5c 66 42 63 6c 6f 63 6b 20 6d 69   and \fBclock mi
33b0: 63 72 6f 73 65 63 6f 6e 64 73 5c 66 52 20 72 65  croseconds\fR re
33c0: 74 75 72 6e 73 20 74 68 65 20 63 6f 75 6e 74 20  turns the count 
33d0: 6f 66 20 6d 69 63 72 6f 73 65 63 6f 6e 64 73 0a  of microseconds.
33e0: 66 72 6f 6d 20 74 68 65 20 65 70 6f 63 68 20 74  from the epoch t
33f0: 69 6d 65 2e 20 49 6e 20 61 64 64 69 74 69 6f 6e  ime. In addition
3400: 2c 20 74 68 65 72 65 20 69 73 20 61 20 5c 66 42  , there is a \fB
3410: 63 6c 6f 63 6b 20 63 6c 69 63 6b 73 5c 66 52 20  clock clicks\fR 
3420: 63 6f 6d 6d 61 6e 64 0a 74 68 61 74 20 72 65 74  command.that ret
3430: 75 72 6e 73 20 61 20 70 6c 61 74 66 6f 72 6d 2d  urns a platform-
3440: 64 65 70 65 6e 64 65 6e 74 20 68 69 67 68 2d 72  dependent high-r
3450: 65 73 6f 6c 75 74 69 6f 6e 20 74 69 6d 65 72 2e  esolution timer.
3460: 20 20 55 6e 6c 69 6b 65 0a 5c 66 42 63 6c 6f 63    Unlike.\fBcloc
3470: 6b 20 73 65 63 6f 6e 64 73 5c 66 52 20 61 6e 64  k seconds\fR and
3480: 20 5c 66 42 63 6c 6f 63 6b 20 6d 69 6c 6c 69 73   \fBclock millis
3490: 65 63 6f 6e 64 73 5c 66 52 2c 20 74 68 65 20 76  econds\fR, the v
34a0: 61 6c 75 65 0a 6f 66 20 5c 66 42 63 6c 6f 63 6b  alue.of \fBclock
34b0: 20 63 6c 69 63 6b 73 5c 66 52 20 69 73 20 6e 6f   clicks\fR is no
34c0: 74 20 67 75 61 72 61 6e 74 65 65 64 20 74 6f 20  t guaranteed to 
34d0: 62 65 20 74 69 65 64 20 74 6f 20 61 6e 79 20 66  be tied to any f
34e0: 69 78 65 64 0a 65 70 6f 63 68 3b 20 69 74 20 69  ixed.epoch; it i
34f0: 73 20 73 69 6d 70 6c 79 20 69 6e 74 65 6e 64 65  s simply intende
3500: 64 20 74 6f 20 62 65 20 74 68 65 20 6d 6f 73 74  d to be the most
3510: 20 70 72 65 63 69 73 65 20 69 6e 74 65 72 76 61   precise interva
3520: 6c 20 74 69 6d 65 72 0a 61 76 61 69 6c 61 62 6c  l timer.availabl
3530: 65 2c 20 61 6e 64 20 69 73 20 69 6e 74 65 6e 64  e, and is intend
3540: 65 64 20 6f 6e 6c 79 20 66 6f 72 20 72 65 6c 61  ed only for rela
3550: 74 69 76 65 20 74 69 6d 69 6e 67 20 73 74 75 64  tive timing stud
3560: 69 65 73 20 73 75 63 68 20 61 73 0a 62 65 6e 63  ies such as.benc
3570: 68 6d 61 72 6b 73 2e 0a 2e 53 48 20 22 46 4f 52  hmarks...SH "FOR
3580: 4d 41 54 54 49 4e 47 20 54 49 4d 45 53 22 0a 2e  MATTING TIMES"..
3590: 50 50 0a 54 68 65 20 5c 66 42 63 6c 6f 63 6b 20  PP.The \fBclock 
35a0: 66 6f 72 6d 61 74 5c 66 52 20 63 6f 6d 6d 61 6e  format\fR comman
35b0: 64 20 70 72 6f 64 75 63 65 73 20 74 69 6d 65 73  d produces times
35c0: 20 66 6f 72 20 64 69 73 70 6c 61 79 20 74 6f 20   for display to 
35d0: 61 20 75 73 65 72 0a 6f 72 20 77 72 69 74 69 6e  a user.or writin
35e0: 67 20 74 6f 20 61 6e 20 65 78 74 65 72 6e 61 6c  g to an external
35f0: 20 6d 65 64 69 75 6d 2e 20 20 54 68 65 20 63 6f   medium.  The co
3600: 6d 6d 61 6e 64 20 61 63 63 65 70 74 73 20 74 69  mmand accepts ti
3610: 6d 65 73 20 74 68 61 74 20 61 72 65 0a 65 78 70  mes that are.exp
3620: 72 65 73 73 65 64 20 69 6e 20 73 65 63 6f 6e 64  ressed in second
3630: 73 20 66 72 6f 6d 20 74 68 65 20 65 70 6f 63 68  s from the epoch
3640: 20 74 69 6d 65 20 6f 66 20 31 20 4a 61 6e 75 61   time of 1 Janua
3650: 72 79 20 31 39 37 30 2c 20 30 30 3a 30 30 20 55  ry 1970, 00:00 U
3660: 54 43 2c 0a 61 73 20 72 65 74 75 72 6e 65 64 20  TC,.as returned 
3670: 62 79 20 5c 66 42 63 6c 6f 63 6b 20 73 65 63 6f  by \fBclock seco
3680: 6e 64 73 5c 66 52 2c 20 5c 66 42 63 6c 6f 63 6b  nds\fR, \fBclock
3690: 20 73 63 61 6e 5c 66 52 2c 20 5c 66 42 63 6c 6f   scan\fR, \fBclo
36a0: 63 6b 20 61 64 64 5c 66 52 2c 0a 5c 66 42 66 69  ck add\fR,.\fBfi
36b0: 6c 65 20 61 74 69 6d 65 5c 66 52 20 6f 72 20 5c  le atime\fR or \
36c0: 66 42 66 69 6c 65 20 6d 74 69 6d 65 5c 66 52 2e  fBfile mtime\fR.
36d0: 0a 2e 50 50 0a 49 66 20 61 20 5c 66 42 5c 2d 66  ..PP.If a \fB\-f
36e0: 6f 72 6d 61 74 5c 66 52 20 6f 70 74 69 6f 6e 20  ormat\fR option 
36f0: 69 73 20 70 72 65 73 65 6e 74 2c 20 74 68 65 20  is present, the 
3700: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65  following argume
3710: 6e 74 20 69 73 0a 61 20 73 74 72 69 6e 67 20 74  nt is.a string t
3720: 68 61 74 20 73 70 65 63 69 66 69 65 73 20 68 6f  hat specifies ho
3730: 77 20 74 68 65 20 64 61 74 65 20 61 6e 64 20 74  w the date and t
3740: 69 6d 65 20 61 72 65 20 74 6f 20 62 65 20 66 6f  ime are to be fo
3750: 72 6d 61 74 74 65 64 2e 0a 54 68 65 20 73 74 72  rmatted..The str
3760: 69 6e 67 20 63 6f 6e 73 69 73 74 73 0a 6f 66 20  ing consists.of 
3770: 61 6e 79 20 6e 75 6d 62 65 72 20 6f 66 20 63 68  any number of ch
3780: 61 72 61 63 74 65 72 73 20 6f 74 68 65 72 20 74  aracters other t
3790: 68 61 6e 20 74 68 65 20 70 65 72 2d 63 65 6e 74  han the per-cent
37a0: 20 73 69 67 6e 0a 2e 50 51 20 5c 66 42 25 5c 66   sign..PQ \fB%\f
37b0: 52 0a 69 6e 74 65 72 73 70 65 72 73 65 64 20 77  R.interspersed w
37c0: 69 74 68 20 61 6e 79 20 6e 75 6d 62 65 72 20 6f  ith any number o
37d0: 66 20 5c 66 49 66 6f 72 6d 61 74 20 67 72 6f 75  f \fIformat grou
37e0: 70 73 5c 66 52 2c 20 77 68 69 63 68 20 61 72 65  ps\fR, which are
37f0: 20 74 77 6f 2d 63 68 61 72 61 63 74 65 72 0a 73   two-character.s
3800: 65 71 75 65 6e 63 65 73 20 62 65 67 69 6e 6e 69  equences beginni
3810: 6e 67 20 77 69 74 68 20 74 68 65 20 70 65 72 2d  ng with the per-
3820: 63 65 6e 74 20 73 69 67 6e 2e 20 20 54 68 65 20  cent sign.  The 
3830: 70 65 72 6d 69 73 73 69 62 6c 65 20 66 6f 72 6d  permissible form
3840: 61 74 20 67 72 6f 75 70 73 2c 0a 61 6e 64 20 74  at groups,.and t
3850: 68 65 69 72 20 69 6e 74 65 72 70 72 65 74 61 74  heir interpretat
3860: 69 6f 6e 2c 20 61 72 65 20 64 65 73 63 72 69 62  ion, are describ
3870: 65 64 20 75 6e 64 65 72 20 5c 66 42 46 4f 52 4d  ed under \fBFORM
3880: 41 54 20 47 52 4f 55 50 53 5c 66 52 2e 0a 2e 50  AT GROUPS\fR...P
3890: 50 0a 49 66 20 61 20 5c 66 42 5c 2d 74 69 6d 65  P.If a \fB\-time
38a0: 7a 6f 6e 65 5c 66 52 20 6f 70 74 69 6f 6e 20 69  zone\fR option i
38b0: 73 20 70 72 65 73 65 6e 74 2c 20 74 68 65 20 66  s present, the f
38c0: 6f 6c 6c 6f 77 69 6e 67 0a 61 72 67 75 6d 65 6e  ollowing.argumen
38d0: 74 20 69 73 20 61 20 73 74 72 69 6e 67 20 74 68  t is a string th
38e0: 61 74 20 73 70 65 63 69 66 69 65 73 20 74 68 65  at specifies the
38f0: 20 74 69 6d 65 20 7a 6f 6e 65 20 69 6e 20 77 68   time zone in wh
3900: 69 63 68 20 74 68 65 20 64 61 74 65 20 61 6e 64  ich the date and
3910: 20 74 69 6d 65 0a 61 72 65 20 74 6f 20 62 65 20   time.are to be 
3920: 66 6f 72 6d 61 74 74 65 64 2e 20 20 41 73 20 61  formatted.  As a
3930: 6e 20 61 6c 74 65 72 6e 61 74 69 76 65 20 74 6f  n alternative to
3940: 0a 2e 51 57 20 22 5c 66 42 5c 2d 74 69 6d 65 7a  ..QW "\fB\-timez
3950: 6f 6e 65 5c 66 49 20 3a 55 54 43 5c 66 52 22 20  one\fI :UTC\fR" 
3960: 2c 0a 74 68 65 20 6f 62 73 6f 6c 65 74 65 20 75  ,.the obsolete u
3970: 73 61 67 65 0a 2e 51 57 20 22 5c 66 42 5c 2d 67  sage..QW "\fB\-g
3980: 6d 74 5c 66 49 20 74 72 75 65 5c 66 52 22 0a 6d  mt\fI true\fR".m
3990: 61 79 20 62 65 20 75 73 65 64 2e 20 20 53 65 65  ay be used.  See
39a0: 0a 5c 66 42 54 49 4d 45 20 5a 4f 4e 45 53 5c 66  .\fBTIME ZONES\f
39b0: 52 20 66 6f 72 20 74 68 65 20 70 65 72 6d 69 73  R for the permis
39c0: 73 69 62 6c 65 20 76 61 72 69 61 6e 74 73 20 66  sible variants f
39d0: 6f 72 20 74 68 65 20 74 69 6d 65 20 7a 6f 6e 65  or the time zone
39e0: 2e 0a 2e 50 50 0a 49 66 20 61 20 5c 66 42 5c 2d  ...PP.If a \fB\-
39f0: 6c 6f 63 61 6c 65 5c 66 52 20 6f 70 74 69 6f 6e  locale\fR option
3a00: 20 69 73 20 70 72 65 73 65 6e 74 2c 20 74 68 65   is present, the
3a10: 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d   following argum
3a20: 65 6e 74 20 69 73 0a 61 20 73 74 72 69 6e 67 20  ent is.a string 
3a30: 74 68 61 74 20 73 70 65 63 69 66 69 65 73 20 74  that specifies t
3a40: 68 65 20 6c 6f 63 61 6c 65 20 69 6e 20 77 68 69  he locale in whi
3a50: 63 68 20 74 68 65 20 74 69 6d 65 20 69 73 20 74  ch the time is t
3a60: 6f 20 62 65 20 66 6f 72 6d 61 74 74 65 64 2c 0a  o be formatted,.
3a70: 69 6e 20 74 68 65 20 73 61 6d 65 20 66 6f 72 6d  in the same form
3a80: 61 74 20 74 68 61 74 20 69 73 20 75 73 65 64 20  at that is used 
3a90: 66 6f 72 20 74 68 65 20 5c 66 42 6d 73 67 63 61  for the \fBmsgca
3aa0: 74 5c 66 52 20 70 61 63 6b 61 67 65 2e 20 20 4e  t\fR package.  N
3ab0: 6f 74 65 0a 74 68 61 74 20 74 68 65 20 64 65 66  ote.that the def
3ac0: 61 75 6c 74 2c 20 69 66 20 5c 66 42 5c 2d 6c 6f  ault, if \fB\-lo
3ad0: 63 61 6c 65 5c 66 52 20 69 73 20 6e 6f 74 20 73  cale\fR is not s
3ae0: 70 65 63 69 66 69 65 64 2c 20 69 73 20 74 68 65  pecified, is the
3af0: 20 72 6f 6f 74 20 6c 6f 63 61 6c 65 0a 5c 66 42   root locale.\fB
3b00: 7b 7d 5c 66 52 20 72 61 74 68 65 72 20 74 68 61  {}\fR rather tha
3b10: 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20 6c 6f  n the current lo
3b20: 63 61 6c 65 2e 20 20 54 68 65 20 63 75 72 72 65  cale.  The curre
3b30: 6e 74 20 6c 6f 63 61 6c 65 20 6d 61 79 0a 62 65  nt locale may.be
3b40: 20 6f 62 74 61 69 6e 65 64 20 62 79 20 75 73 69   obtained by usi
3b50: 6e 67 20 5c 66 42 5c 2d 6c 6f 63 61 6c 65 20 63  ng \fB\-locale c
3b60: 75 72 72 65 6e 74 5c 66 52 2e 0a 49 6e 20 61 64  urrent\fR..In ad
3b70: 64 69 74 69 6f 6e 2c 20 73 6f 6d 65 20 70 6c 61  dition, some pla
3b80: 74 66 6f 72 6d 73 20 73 75 70 70 6f 72 74 20 61  tforms support a
3b90: 20 5c 66 42 73 79 73 74 65 6d 5c 66 52 20 6c 6f   \fBsystem\fR lo
3ba0: 63 61 6c 65 20 74 68 61 74 0a 72 65 66 6c 65 63  cale that.reflec
3bb0: 74 73 20 74 68 65 20 75 73 65 72 27 73 20 63 75  ts the user's cu
3bc0: 72 72 65 6e 74 20 63 68 6f 69 63 65 73 2e 20 20  rrent choices.  
3bd0: 46 6f 72 20 69 6e 73 74 61 6e 63 65 2c 20 6f 6e  For instance, on
3be0: 20 57 69 6e 64 6f 77 73 2c 20 74 68 65 0a 66 6f   Windows, the.fo
3bf0: 72 6d 61 74 20 74 68 61 74 20 74 68 65 20 75 73  rmat that the us
3c00: 65 72 20 68 61 73 20 73 65 6c 65 63 74 65 64 20  er has selected 
3c10: 66 72 6f 6d 20 64 61 74 65 73 20 61 6e 64 20 74  from dates and t
3c20: 69 6d 65 73 20 69 6e 20 74 68 65 20 43 6f 6e 74  imes in the Cont
3c30: 72 6f 6c 0a 50 61 6e 65 6c 20 63 61 6e 20 62 65  rol.Panel can be
3c40: 20 6f 62 74 61 69 6e 65 64 20 62 79 20 75 73 69   obtained by usi
3c50: 6e 67 20 74 68 65 20 5c 66 42 73 79 73 74 65 6d  ng the \fBsystem
3c60: 5c 66 52 20 6c 6f 63 61 6c 65 2e 20 20 4f 6e 0a  \fR locale.  On.
3c70: 70 6c 61 74 66 6f 72 6d 73 20 74 68 61 74 20 64  platforms that d
3c80: 6f 20 6e 6f 74 20 64 65 66 69 6e 65 20 61 20 75  o not define a u
3c90: 73 65 72 20 73 65 6c 65 63 74 69 6f 6e 20 6f 66  ser selection of
3ca0: 20 64 61 74 65 20 61 6e 64 20 74 69 6d 65 20 66   date and time f
3cb0: 6f 72 6d 61 74 73 0a 73 65 70 61 72 61 74 65 20  ormats.separate 
3cc0: 66 72 6f 6d 20 5c 66 42 4c 43 5f 54 49 4d 45 5c  from \fBLC_TIME\
3cd0: 66 52 2c 20 5c 66 42 5c 2d 6c 6f 63 61 6c 65 20  fR, \fB\-locale 
3ce0: 73 79 73 74 65 6d 5c 66 52 20 69 73 0a 73 79 6e  system\fR is.syn
3cf0: 6f 6e 79 6d 6f 75 73 20 77 69 74 68 20 5c 66 42  onymous with \fB
3d00: 5c 2d 6c 6f 63 61 6c 65 20 63 75 72 72 65 6e 74  \-locale current
3d10: 5c 66 52 2e 0a 2e 53 48 20 22 53 43 41 4e 4e 49  \fR...SH "SCANNI
3d20: 4e 47 20 54 49 4d 45 53 22 0a 2e 50 50 0a 54 68  NG TIMES"..PP.Th
3d30: 65 20 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e 5c  e \fBclock scan\
3d40: 66 52 20 63 6f 6d 6d 61 6e 64 20 61 63 63 65 70  fR command accep
3d50: 74 73 20 74 69 6d 65 73 20 74 68 61 74 20 61 72  ts times that ar
3d60: 65 20 66 6f 72 6d 61 74 74 65 64 20 61 73 0a 73  e formatted as.s
3d70: 74 72 69 6e 67 73 20 61 6e 64 20 63 6f 6e 76 65  trings and conve
3d80: 72 74 73 20 74 68 65 6d 20 74 6f 20 63 6f 75 6e  rts them to coun
3d90: 74 73 20 6f 66 20 73 65 63 6f 6e 64 73 20 66 72  ts of seconds fr
3da0: 6f 6d 20 74 68 65 20 65 70 6f 63 68 20 74 69 6d  om the epoch tim
3db0: 65 0a 6f 66 20 31 20 4a 61 6e 75 61 72 79 20 31  e.of 1 January 1
3dc0: 39 37 30 2c 20 30 30 3a 30 30 20 55 54 43 2e 20  970, 00:00 UTC. 
3dd0: 20 49 74 20 6e 6f 72 6d 61 6c 6c 79 20 74 61 6b   It normally tak
3de0: 65 73 20 61 20 5c 66 42 5c 2d 66 6f 72 6d 61 74  es a \fB\-format
3df0: 5c 66 52 0a 6f 70 74 69 6f 6e 20 74 68 61 74 20  \fR.option that 
3e00: 69 73 20 66 6f 6c 6c 6f 77 65 64 20 62 79 20 61  is followed by a
3e10: 20 73 74 72 69 6e 67 20 64 65 73 63 72 69 62 69   string describi
3e20: 6e 67 0a 74 68 65 20 65 78 70 65 63 74 65 64 20  ng.the expected 
3e30: 66 6f 72 6d 61 74 20 6f 66 20 74 68 65 20 69 6e  format of the in
3e40: 70 75 74 2e 20 20 28 53 65 65 0a 5c 66 42 46 52  put.  (See.\fBFR
3e50: 45 45 20 46 4f 52 4d 20 53 43 41 4e 5c 66 52 20  EE FORM SCAN\fR 
3e60: 66 6f 72 20 74 68 65 20 65 66 66 65 63 74 20 6f  for the effect o
3e70: 66 20 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e 5c  f \fBclock scan\
3e80: 66 52 0a 77 69 74 68 6f 75 74 20 73 75 63 68 20  fR.without such 
3e90: 61 6e 20 61 72 67 75 6d 65 6e 74 2e 29 20 20 54  an argument.)  T
3ea0: 68 65 20 73 74 72 69 6e 67 20 63 6f 6e 73 69 73  he string consis
3eb0: 74 73 20 6f 66 20 61 6e 79 20 6e 75 6d 62 65 72  ts of any number
3ec0: 20 6f 66 0a 63 68 61 72 61 63 74 65 72 73 20 6f   of.characters o
3ed0: 74 68 65 72 20 74 68 61 6e 20 74 68 65 20 70 65  ther than the pe
3ee0: 72 2d 63 65 6e 74 20 73 69 67 6e 0a 2e 50 51 20  r-cent sign..PQ 
3ef0: 5c 66 42 25 5c 66 52 20 22 22 20 2c 0a 69 6e 74  \fB%\fR "" ,.int
3f00: 65 72 73 70 65 72 73 65 64 20 77 69 74 68 20 61  erspersed with a
3f10: 6e 79 20 6e 75 6d 62 65 72 20 6f 66 20 5c 66 49  ny number of \fI
3f20: 66 6f 72 6d 61 74 20 67 72 6f 75 70 73 5c 66 52  format groups\fR
3f30: 2c 20 77 68 69 63 68 20 61 72 65 20 74 77 6f 2d  , which are two-
3f40: 63 68 61 72 61 63 74 65 72 0a 73 65 71 75 65 6e  character.sequen
3f50: 63 65 73 20 62 65 67 69 6e 6e 69 6e 67 20 77 69  ces beginning wi
3f60: 74 68 20 74 68 65 20 70 65 72 2d 63 65 6e 74 20  th the per-cent 
3f70: 73 69 67 6e 2e 20 20 54 68 65 20 70 65 72 6d 69  sign.  The permi
3f80: 73 73 69 62 6c 65 20 66 6f 72 6d 61 74 20 67 72  ssible format gr
3f90: 6f 75 70 73 2c 0a 61 6e 64 20 74 68 65 69 72 20  oups,.and their 
3fa0: 69 6e 74 65 72 70 72 65 74 61 74 69 6f 6e 2c 20  interpretation, 
3fb0: 61 72 65 20 64 65 73 63 72 69 62 65 64 20 75 6e  are described un
3fc0: 64 65 72 20 5c 66 42 46 4f 52 4d 41 54 20 47 52  der \fBFORMAT GR
3fd0: 4f 55 50 53 5c 66 52 2e 0a 2e 50 50 0a 49 66 20  OUPS\fR...PP.If 
3fe0: 61 20 5c 66 42 5c 2d 74 69 6d 65 7a 6f 6e 65 5c  a \fB\-timezone\
3ff0: 66 52 20 6f 70 74 69 6f 6e 20 69 73 20 70 72 65  fR option is pre
4000: 73 65 6e 74 2c 20 74 68 65 20 66 6f 6c 6c 6f 77  sent, the follow
4010: 69 6e 67 0a 61 72 67 75 6d 65 6e 74 20 69 73 20  ing.argument is 
4020: 61 20 73 74 72 69 6e 67 20 74 68 61 74 20 73 70  a string that sp
4030: 65 63 69 66 69 65 73 20 74 68 65 20 74 69 6d 65  ecifies the time
4040: 20 7a 6f 6e 65 20 69 6e 20 77 68 69 63 68 20 74   zone in which t
4050: 68 65 20 64 61 74 65 20 61 6e 64 20 74 69 6d 65  he date and time
4060: 0a 61 72 65 20 74 6f 20 62 65 20 69 6e 74 65 72  .are to be inter
4070: 70 72 65 74 65 64 2e 20 20 41 73 20 61 6e 20 61  preted.  As an a
4080: 6c 74 65 72 6e 61 74 69 76 65 20 74 6f 20 5c 66  lternative to \f
4090: 42 5c 2d 74 69 6d 65 7a 6f 6e 65 5c 66 49 20 3a  B\-timezone\fI :
40a0: 55 54 43 5c 66 52 2c 0a 74 68 65 20 6f 62 73 6f  UTC\fR,.the obso
40b0: 6c 65 74 65 20 75 73 61 67 65 20 5c 66 42 5c 2d  lete usage \fB\-
40c0: 67 6d 74 5c 66 49 20 74 72 75 65 5c 66 52 20 6d  gmt\fI true\fR m
40d0: 61 79 20 62 65 20 75 73 65 64 2e 20 20 53 65 65  ay be used.  See
40e0: 0a 5c 66 42 54 49 4d 45 20 5a 4f 4e 45 53 5c 66  .\fBTIME ZONES\f
40f0: 52 20 66 6f 72 20 74 68 65 20 70 65 72 6d 69 73  R for the permis
4100: 73 69 62 6c 65 20 76 61 72 69 61 6e 74 73 20 66  sible variants f
4110: 6f 72 20 74 68 65 20 74 69 6d 65 20 7a 6f 6e 65  or the time zone
4120: 2e 0a 2e 50 50 0a 49 66 20 61 20 5c 66 42 5c 2d  ...PP.If a \fB\-
4130: 6c 6f 63 61 6c 65 5c 66 52 20 6f 70 74 69 6f 6e  locale\fR option
4140: 20 69 73 20 70 72 65 73 65 6e 74 2c 20 74 68 65   is present, the
4150: 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d   following argum
4160: 65 6e 74 20 69 73 0a 61 20 73 74 72 69 6e 67 20  ent is.a string 
4170: 74 68 61 74 20 73 70 65 63 69 66 69 65 73 20 74  that specifies t
4180: 68 65 20 6c 6f 63 61 6c 65 20 69 6e 20 77 68 69  he locale in whi
4190: 63 68 20 74 68 65 20 74 69 6d 65 20 69 73 20 74  ch the time is t
41a0: 6f 20 62 65 20 69 6e 74 65 72 70 72 65 74 65 64  o be interpreted
41b0: 2c 0a 69 6e 20 74 68 65 20 73 61 6d 65 20 66 6f  ,.in the same fo
41c0: 72 6d 61 74 20 74 68 61 74 20 69 73 20 75 73 65  rmat that is use
41d0: 64 20 66 6f 72 20 74 68 65 20 5c 66 42 6d 73 67  d for the \fBmsg
41e0: 63 61 74 5c 66 52 20 70 61 63 6b 61 67 65 2e 20  cat\fR package. 
41f0: 20 4e 6f 74 65 0a 74 68 61 74 20 74 68 65 20 64   Note.that the d
4200: 65 66 61 75 6c 74 2c 20 69 66 20 5c 66 42 5c 2d  efault, if \fB\-
4210: 6c 6f 63 61 6c 65 5c 66 52 20 69 73 20 6e 6f 74  locale\fR is not
4220: 20 73 70 65 63 69 66 69 65 64 2c 20 69 73 20 74   specified, is t
4230: 68 65 20 72 6f 6f 74 20 6c 6f 63 61 6c 65 0a 5c  he root locale.\
4240: 66 42 7b 7d 5c 66 52 20 72 61 74 68 65 72 20 74  fB{}\fR rather t
4250: 68 61 6e 20 74 68 65 20 63 75 72 72 65 6e 74 20  han the current 
4260: 6c 6f 63 61 6c 65 2e 20 20 54 68 65 20 63 75 72  locale.  The cur
4270: 72 65 6e 74 20 6c 6f 63 61 6c 65 20 6d 61 79 0a  rent locale may.
4280: 62 65 20 6f 62 74 61 69 6e 65 64 20 62 79 20 75  be obtained by u
4290: 73 69 6e 67 20 5c 66 42 5c 2d 6c 6f 63 61 6c 65  sing \fB\-locale
42a0: 20 63 75 72 72 65 6e 74 5c 66 52 2e 0a 49 6e 20   current\fR..In 
42b0: 61 64 64 69 74 69 6f 6e 2c 20 73 6f 6d 65 20 70  addition, some p
42c0: 6c 61 74 66 6f 72 6d 73 20 73 75 70 70 6f 72 74  latforms support
42d0: 20 61 20 5c 66 42 73 79 73 74 65 6d 5c 66 52 20   a \fBsystem\fR 
42e0: 6c 6f 63 61 6c 65 20 74 68 61 74 0a 72 65 66 6c  locale that.refl
42f0: 65 63 74 73 20 74 68 65 20 75 73 65 72 27 73 20  ects the user's 
4300: 63 75 72 72 65 6e 74 20 63 68 6f 69 63 65 73 2e  current choices.
4310: 20 20 46 6f 72 20 69 6e 73 74 61 6e 63 65 2c 20    For instance, 
4320: 6f 6e 20 57 69 6e 64 6f 77 73 2c 20 74 68 65 0a  on Windows, the.
4330: 66 6f 72 6d 61 74 20 74 68 61 74 20 74 68 65 20  format that the 
4340: 75 73 65 72 20 68 61 73 20 73 65 6c 65 63 74 65  user has selecte
4350: 64 20 66 72 6f 6d 20 64 61 74 65 73 20 61 6e 64  d from dates and
4360: 20 74 69 6d 65 73 20 69 6e 20 74 68 65 20 43 6f   times in the Co
4370: 6e 74 72 6f 6c 0a 50 61 6e 65 6c 20 63 61 6e 20  ntrol.Panel can 
4380: 62 65 20 6f 62 74 61 69 6e 65 64 20 62 79 20 75  be obtained by u
4390: 73 69 6e 67 20 74 68 65 20 5c 66 42 73 79 73 74  sing the \fBsyst
43a0: 65 6d 5c 66 52 20 6c 6f 63 61 6c 65 2e 20 20 4f  em\fR locale.  O
43b0: 6e 0a 70 6c 61 74 66 6f 72 6d 73 20 74 68 61 74  n.platforms that
43c0: 20 64 6f 20 6e 6f 74 20 64 65 66 69 6e 65 20 61   do not define a
43d0: 20 75 73 65 72 20 73 65 6c 65 63 74 69 6f 6e 20   user selection 
43e0: 6f 66 20 64 61 74 65 20 61 6e 64 20 74 69 6d 65  of date and time
43f0: 20 66 6f 72 6d 61 74 73 0a 73 65 70 61 72 61 74   formats.separat
4400: 65 20 66 72 6f 6d 20 5c 66 42 4c 43 5f 54 49 4d  e from \fBLC_TIM
4410: 45 5c 66 52 2c 20 5c 66 42 5c 2d 6c 6f 63 61 6c  E\fR, \fB\-local
4420: 65 20 73 79 73 74 65 6d 5c 66 52 20 69 73 0a 73  e system\fR is.s
4430: 79 6e 6f 6e 79 6d 6f 75 73 20 77 69 74 68 20 5c  ynonymous with \
4440: 66 42 5c 2d 6c 6f 63 61 6c 65 20 63 75 72 72 65  fB\-locale curre
4450: 6e 74 5c 66 52 2e 0a 2e 50 50 0a 49 66 20 61 20  nt\fR...PP.If a 
4460: 5c 66 42 5c 2d 62 61 73 65 5c 66 52 20 6f 70 74  \fB\-base\fR opt
4470: 69 6f 6e 20 69 73 20 70 72 65 73 65 6e 74 2c 20  ion is present, 
4480: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72  the following ar
4490: 67 75 6d 65 6e 74 20 69 73 0a 61 20 74 69 6d 65  gument is.a time
44a0: 20 28 65 78 70 72 65 73 73 65 64 20 69 6e 20 73   (expressed in s
44b0: 65 63 6f 6e 64 73 20 66 72 6f 6d 20 74 68 65 20  econds from the 
44c0: 65 70 6f 63 68 20 74 69 6d 65 29 20 74 68 61 74  epoch time) that
44d0: 20 69 73 20 75 73 65 64 20 61 73 0a 61 20 5c 66   is used as.a \f
44e0: 49 62 61 73 65 20 74 69 6d 65 5c 66 52 20 66 6f  Ibase time\fR fo
44f0: 72 20 69 6e 74 65 72 70 72 65 74 69 6e 67 20 72  r interpreting r
4500: 65 6c 61 74 69 76 65 20 74 69 6d 65 73 2e 20 20  elative times.  
4510: 49 66 20 6e 6f 0a 5c 66 42 5c 2d 62 61 73 65 5c  If no.\fB\-base\
4520: 66 52 20 6f 70 74 69 6f 6e 20 69 73 20 70 72 65  fR option is pre
4530: 73 65 6e 74 2c 20 74 68 65 20 62 61 73 65 20 74  sent, the base t
4540: 69 6d 65 20 69 73 20 74 68 65 20 63 75 72 72 65  ime is the curre
4550: 6e 74 20 74 69 6d 65 2e 0a 2e 50 50 0a 53 63 61  nt time...PP.Sca
4560: 6e 6e 69 6e 67 20 6f 66 20 74 69 6d 65 73 20 69  nning of times i
4570: 6e 20 66 69 78 65 64 20 66 6f 72 6d 61 74 20 77  n fixed format w
4580: 6f 72 6b 73 20 62 79 20 64 65 74 65 72 6d 69 6e  orks by determin
4590: 69 6e 67 20 74 68 72 65 65 20 74 68 69 6e 67 73  ing three things
45a0: 3a 0a 74 68 65 20 64 61 74 65 2c 20 74 68 65 20  :.the date, the 
45b0: 74 69 6d 65 20 6f 66 20 64 61 79 2c 20 61 6e 64  time of day, and
45c0: 20 74 68 65 20 74 69 6d 65 20 7a 6f 6e 65 2e 20   the time zone. 
45d0: 20 54 68 65 73 65 20 74 68 72 65 65 20 61 72 65   These three are
45e0: 20 74 68 65 6e 0a 63 6f 6d 62 69 6e 65 64 20 69   then.combined i
45f0: 6e 74 6f 20 61 20 70 6f 69 6e 74 20 69 6e 20 74  nto a point in t
4600: 69 6d 65 2c 20 77 68 69 63 68 20 69 73 20 72 65  ime, which is re
4610: 74 75 72 6e 65 64 20 61 73 20 74 68 65 20 6e 75  turned as the nu
4620: 6d 62 65 72 20 6f 66 20 73 65 63 6f 6e 64 73 0a  mber of seconds.
4630: 66 72 6f 6d 20 74 68 65 20 65 70 6f 63 68 2e 0a  from the epoch..
4640: 2e 50 50 0a 42 65 66 6f 72 65 20 73 63 61 6e 6e  .PP.Before scann
4650: 69 6e 67 20 62 65 67 69 6e 73 2c 20 74 68 65 20  ing begins, the 
4660: 66 6f 72 6d 61 74 20 73 74 72 69 6e 67 20 69 73  format string is
4670: 20 70 72 65 70 72 6f 63 65 73 73 65 64 0a 74 6f   preprocessed.to
4680: 20 72 65 70 6c 61 63 65 20 5c 66 42 25 63 5c 66   replace \fB%c\f
4690: 52 2c 20 5c 66 42 25 45 63 5c 66 52 2c 20 5c 66  R, \fB%Ec\fR, \f
46a0: 42 25 78 5c 66 52 2c 20 5c 66 42 25 45 78 5c 66  B%x\fR, \fB%Ex\f
46b0: 52 2c 0a 5c 66 42 25 58 5c 66 52 2e 20 5c 66 42  R,.\fB%X\fR. \fB
46c0: 25 45 78 5c 66 52 2c 20 5c 66 42 25 72 5c 66 52  %Ex\fR, \fB%r\fR
46d0: 2c 20 5c 66 42 25 52 5c 66 52 2c 20 5c 66 42 25  , \fB%R\fR, \fB%
46e0: 54 5c 66 52 2c 0a 5c 66 42 25 44 5c 66 52 2c 20  T\fR,.\fB%D\fR, 
46f0: 5c 66 42 25 45 59 5c 66 52 20 61 6e 64 20 5c 66  \fB%EY\fR and \f
4700: 42 25 2b 5c 66 52 20 66 6f 72 6d 61 74 20 67 72  B%+\fR format gr
4710: 6f 75 70 73 20 77 69 74 68 20 63 6f 75 6e 74 65  oups with counte
4720: 72 70 61 72 74 73 0a 74 68 61 74 20 61 72 65 20  rparts.that are 
4730: 61 70 70 72 6f 70 72 69 61 74 65 20 74 6f 20 74  appropriate to t
4740: 68 65 20 63 75 72 72 65 6e 74 20 6c 6f 63 61 6c  he current local
4750: 65 20 61 6e 64 20 63 6f 6e 74 61 69 6e 20 6e 6f  e and contain no
4760: 6e 65 20 6f 66 20 74 68 65 0a 61 62 6f 76 65 20  ne of the.above 
4770: 67 72 6f 75 70 73 2e 20 20 46 6f 72 20 69 6e 73  groups.  For ins
4780: 74 61 6e 63 65 2c 20 5c 66 42 25 44 5c 66 52 20  tance, \fB%D\fR 
4790: 77 69 6c 6c 20 28 69 6e 20 74 68 65 20 5c 66 42  will (in the \fB
47a0: 65 6e 5f 55 53 5c 66 52 20 6c 6f 63 61 6c 65 29  en_US\fR locale)
47b0: 0a 62 65 20 72 65 70 6c 61 63 65 64 20 77 69 74  .be replaced wit
47c0: 68 20 5c 66 42 25 6d 2f 25 64 2f 25 59 5c 66 52  h \fB%m/%d/%Y\fR
47d0: 2e 0a 2e 50 50 0a 54 68 65 20 64 61 74 65 20 69  ...PP.The date i
47e0: 73 20 64 65 74 65 72 6d 69 6e 65 64 20 61 63 63  s determined acc
47f0: 6f 72 64 69 6e 67 20 74 6f 20 74 68 65 20 66 69  ording to the fi
4800: 65 6c 64 73 20 74 68 61 74 20 61 72 65 20 70 72  elds that are pr
4810: 65 73 65 6e 74 20 69 6e 20 74 68 65 0a 70 72 65  esent in the.pre
4820: 70 72 6f 63 65 73 73 65 64 20 66 6f 72 6d 61 74  processed format
4830: 20 73 74 72 69 6e 67 2e 20 20 49 6e 20 6f 72 64   string.  In ord
4840: 65 72 20 6f 66 20 70 72 65 66 65 72 65 6e 63 65  er of preference
4850: 3a 0a 2e 49 50 20 5b 31 5d 0a 49 66 20 74 68 65  :..IP [1].If the
4860: 20 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 73   string contains
4870: 20 61 20 5c 66 42 25 73 5c 66 52 20 66 6f 72 6d   a \fB%s\fR form
4880: 61 74 20 67 72 6f 75 70 2c 20 72 65 70 72 65 73  at group, repres
4890: 65 6e 74 69 6e 67 0a 73 65 63 6f 6e 64 73 20 66  enting.seconds f
48a0: 72 6f 6d 20 74 68 65 20 65 70 6f 63 68 2c 20 74  rom the epoch, t
48b0: 68 61 74 20 67 72 6f 75 70 20 69 73 20 75 73 65  hat group is use
48c0: 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 74  d to determine t
48d0: 68 65 20 64 61 74 65 2e 0a 2e 49 50 20 5b 32 5d  he date...IP [2]
48e0: 0a 49 66 20 74 68 65 20 73 74 72 69 6e 67 20 63  .If the string c
48f0: 6f 6e 74 61 69 6e 73 20 61 20 5c 66 42 25 4a 5c  ontains a \fB%J\
4900: 66 52 2c 20 5c 66 42 25 45 4a 5c 66 52 20 6f 72  fR, \fB%EJ\fR or
4910: 20 5c 66 42 25 45 6a 5c 66 52 20 66 6f 72 6d 61   \fB%Ej\fR forma
4920: 74 20 67 72 6f 75 70 73 2c 0a 72 65 70 72 65 73  t groups,.repres
4930: 65 6e 74 69 6e 67 20 74 68 65 20 43 61 6c 65 6e  enting the Calen
4940: 64 61 72 20 6f 72 20 41 73 74 72 6f 6e 6f 6d 69  dar or Astronomi
4950: 63 61 6c 20 4a 75 6c 69 61 6e 20 44 61 79 20 4e  cal Julian Day N
4960: 75 6d 62 65 72 2c 20 74 68 61 74 20 67 72 6f 75  umber, that grou
4970: 70 73 0a 61 72 65 20 75 73 65 64 20 74 6f 20 64  ps.are used to d
4980: 65 74 65 72 6d 69 6e 65 20 74 68 65 20 64 61 74  etermine the dat
4990: 65 2e 0a 4e 6f 74 65 2c 20 74 68 61 74 20 69 6e  e..Note, that in
49a0: 20 63 61 73 65 20 6f 66 20 5c 66 42 25 45 4a 5c   case of \fB%EJ\
49b0: 66 52 20 6f 72 20 5c 66 42 25 45 6a 5c 66 52 20  fR or \fB%Ej\fR 
49c0: 66 6f 72 6d 61 74 20 67 72 6f 75 70 73 2c 20 72  format groups, r
49d0: 65 70 72 65 73 65 6e 74 69 6e 67 0a 74 68 65 20  epresenting.the 
49e0: 4a 75 6c 69 61 6e 20 44 61 74 65 20 77 69 74 68  Julian Date with
49f0: 20 74 69 6d 65 20 66 72 61 63 74 69 6f 6e 2c 20   time fraction, 
4a00: 74 68 69 73 20 67 72 6f 75 70 73 20 6d 61 79 20  this groups may 
4a10: 62 65 20 75 73 65 64 20 74 6f 20 64 65 74 65 72  be used to deter
4a20: 6d 69 6e 65 0a 74 68 65 20 64 61 74 65 20 61 6e  mine.the date an
4a30: 64 20 74 69 6d 65 2e 0a 2e 49 50 20 5b 33 5d 0a  d time...IP [3].
4a40: 49 66 20 74 68 65 20 73 74 72 69 6e 67 20 63 6f  If the string co
4a50: 6e 74 61 69 6e 73 20 61 20 63 6f 6d 70 6c 65 74  ntains a complet
4a60: 65 20 73 65 74 20 6f 66 20 66 6f 72 6d 61 74 20  e set of format 
4a70: 67 72 6f 75 70 73 20 73 70 65 63 69 66 79 69 6e  groups specifyin
4a80: 67 0a 63 65 6e 74 75 72 79 2c 20 79 65 61 72 2c  g.century, year,
4a90: 20 6d 6f 6e 74 68 2c 20 61 6e 64 20 64 61 79 20   month, and day 
4aa0: 6f 66 20 6d 6f 6e 74 68 3b 20 63 65 6e 74 75 72  of month; centur
4ab0: 79 2c 20 79 65 61 72 2c 20 61 6e 64 20 64 61 79  y, year, and day
4ac0: 20 6f 66 20 79 65 61 72 3b 0a 6f 72 20 49 53 4f   of year;.or ISO
4ad0: 38 36 30 31 20 66 69 73 63 61 6c 20 79 65 61 72  8601 fiscal year
4ae0: 2c 20 77 65 65 6b 20 6f 66 20 79 65 61 72 2c 20  , week of year, 
4af0: 61 6e 64 20 64 61 79 20 6f 66 20 77 65 65 6b 3b  and day of week;
4b00: 20 74 68 6f 73 65 20 67 72 6f 75 70 73 20 61 72   those groups ar
4b10: 65 0a 63 6f 6d 62 69 6e 65 64 20 61 6e 64 20 75  e.combined and u
4b20: 73 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65  sed to determine
4b30: 20 74 68 65 20 64 61 74 65 2e 20 20 49 66 20 6d   the date.  If m
4b40: 6f 72 65 20 74 68 61 6e 20 6f 6e 65 20 63 6f 6d  ore than one com
4b50: 70 6c 65 74 65 0a 73 65 74 20 69 73 20 70 72 65  plete.set is pre
4b60: 73 65 6e 74 2c 20 74 68 65 20 6f 6e 65 20 61 74  sent, the one at
4b70: 20 74 68 65 20 72 69 67 68 74 6d 6f 73 74 20 70   the rightmost p
4b80: 6f 73 69 74 69 6f 6e 20 69 6e 20 74 68 65 20 73  osition in the s
4b90: 74 72 69 6e 67 20 69 73 0a 75 73 65 64 2e 0a 2e  tring is.used...
4ba0: 49 50 20 5b 34 5d 0a 49 66 20 74 68 65 20 73 74  IP [4].If the st
4bb0: 72 69 6e 67 20 6c 61 63 6b 73 20 61 20 63 65 6e  ring lacks a cen
4bc0: 74 75 72 79 20 62 75 74 20 63 6f 6e 74 61 69 6e  tury but contain
4bd0: 73 20 61 20 73 65 74 20 6f 66 20 66 6f 72 6d 61  s a set of forma
4be0: 74 0a 67 72 6f 75 70 73 20 73 70 65 63 69 66 79  t.groups specify
4bf0: 69 6e 67 20 79 65 61 72 20 6f 66 20 63 65 6e 74  ing year of cent
4c00: 75 72 79 2c 20 6d 6f 6e 74 68 20 61 6e 64 20 64  ury, month and d
4c10: 61 79 20 6f 66 20 6d 6f 6e 74 68 3b 20 79 65 61  ay of month; yea
4c20: 72 20 6f 66 0a 63 65 6e 74 75 72 79 20 61 6e 64  r of.century and
4c30: 20 64 61 79 20 6f 66 20 79 65 61 72 3b 20 6f 72   day of year; or
4c40: 20 74 77 6f 2d 64 69 67 69 74 20 49 53 4f 38 36   two-digit ISO86
4c50: 30 31 20 66 69 73 63 61 6c 20 79 65 61 72 2c 20  01 fiscal year, 
4c60: 77 65 65 6b 20 6f 66 20 79 65 61 72 2c 0a 61 6e  week of year,.an
4c70: 64 20 64 61 79 20 6f 66 20 77 65 65 6b 3b 20 74  d day of week; t
4c80: 68 6f 73 65 20 67 72 6f 75 70 73 20 61 72 65 0a  hose groups are.
4c90: 63 6f 6d 62 69 6e 65 64 20 61 6e 64 20 75 73 65  combined and use
4ca0: 64 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 74  d to determine t
4cb0: 68 65 20 64 61 74 65 2e 20 20 49 66 20 6d 6f 72  he date.  If mor
4cc0: 65 20 74 68 61 6e 20 6f 6e 65 20 63 6f 6d 70 6c  e than one compl
4cd0: 65 74 65 0a 73 65 74 20 69 73 20 70 72 65 73 65  ete.set is prese
4ce0: 6e 74 2c 20 74 68 65 20 6f 6e 65 20 61 74 20 74  nt, the one at t
4cf0: 68 65 20 72 69 67 68 74 6d 6f 73 74 20 70 6f 73  he rightmost pos
4d00: 69 74 69 6f 6e 20 69 6e 20 74 68 65 20 73 74 72  ition in the str
4d10: 69 6e 67 20 69 73 0a 75 73 65 64 2e 20 20 54 68  ing is.used.  Th
4d20: 65 20 79 65 61 72 20 69 73 20 70 72 65 73 75 6d  e year is presum
4d30: 65 64 20 74 6f 20 6c 69 65 20 69 6e 20 74 68 65  ed to lie in the
4d40: 20 72 61 6e 67 65 20 31 39 33 38 20 74 6f 20 32   range 1938 to 2
4d50: 30 33 37 20 69 6e 63 6c 75 73 69 76 65 2e 0a 2e  037 inclusive...
4d60: 49 50 20 5b 35 5d 0a 49 66 20 74 68 65 20 73 74  IP [5].If the st
4d70: 72 69 6e 67 20 65 6e 74 69 72 65 6c 79 20 6c 61  ring entirely la
4d80: 63 6b 73 20 61 6e 79 20 73 70 65 63 69 66 69 63  cks any specific
4d90: 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 79 65  ation for the ye
4da0: 61 72 0a 28 6f 72 20 63 6f 6e 74 61 69 6e 73 20  ar.(or contains 
4db0: 74 68 65 20 79 65 61 72 20 6f 6e 6c 79 20 6f 6e  the year only on
4dc0: 20 74 68 65 20 6c 6f 63 61 6c 65 27 73 20 61 6c   the locale's al
4dd0: 74 65 72 6e 61 74 69 76 65 20 63 61 6c 65 6e 64  ternative calend
4de0: 61 72 29 0a 61 6e 64 20 63 6f 6e 74 61 69 6e 73  ar).and contains
4df0: 20 61 20 73 65 74 20 6f 66 20 66 6f 72 6d 61 74   a set of format
4e00: 20 67 72 6f 75 70 73 20 73 70 65 63 69 66 79 69   groups specifyi
4e10: 6e 67 20 6d 6f 6e 74 68 20 61 6e 64 20 64 61 79  ng month and day
4e20: 20 6f 66 20 6d 6f 6e 74 68 2c 0a 64 61 79 20 6f   of month,.day o
4e30: 66 20 79 65 61 72 2c 20 6f 72 20 77 65 65 6b 20  f year, or week 
4e40: 6f 66 20 79 65 61 72 20 61 6e 64 20 64 61 79 20  of year and day 
4e50: 6f 66 20 77 65 65 6b 2c 20 74 68 6f 73 65 20 67  of week, those g
4e60: 72 6f 75 70 73 20 61 72 65 0a 63 6f 6d 62 69 6e  roups are.combin
4e70: 65 64 20 61 6e 64 20 75 73 65 64 20 74 6f 20 64  ed and used to d
4e80: 65 74 65 72 6d 69 6e 65 20 74 68 65 20 64 61 74  etermine the dat
4e90: 65 2e 20 20 49 66 20 6d 6f 72 65 20 74 68 61 6e  e.  If more than
4ea0: 20 6f 6e 65 20 63 6f 6d 70 6c 65 74 65 0a 73 65   one complete.se
4eb0: 74 20 69 73 20 70 72 65 73 65 6e 74 2c 20 74 68  t is present, th
4ec0: 65 20 6f 6e 65 20 61 74 20 74 68 65 20 72 69 67  e one at the rig
4ed0: 68 74 6d 6f 73 74 20 70 6f 73 69 74 69 6f 6e 20  htmost position 
4ee0: 69 6e 20 74 68 65 20 73 74 72 69 6e 67 20 69 73  in the string is
4ef0: 0a 75 73 65 64 2e 20 20 54 68 65 20 79 65 61 72  .used.  The year
4f00: 20 69 73 20 64 65 74 65 72 6d 69 6e 65 64 20 62   is determined b
4f10: 79 20 69 6e 74 65 72 70 72 65 74 69 6e 67 20 74  y interpreting t
4f20: 68 65 20 62 61 73 65 20 74 69 6d 65 20 69 6e 20  he base time in 
4f30: 74 68 65 20 67 69 76 65 6e 0a 74 69 6d 65 20 7a  the given.time z
4f40: 6f 6e 65 2e 0a 2e 49 50 20 5b 36 5d 0a 49 66 20  one...IP [6].If 
4f50: 74 68 65 20 73 74 72 69 6e 67 20 63 6f 6e 74 61  the string conta
4f60: 69 6e 73 20 6e 6f 6e 65 20 6f 66 20 74 68 65 20  ins none of the 
4f70: 61 62 6f 76 65 20 73 65 74 73 2c 20 62 75 74 20  above sets, but 
4f80: 68 61 73 20 61 20 64 61 79 0a 6f 66 20 74 68 65  has a day.of the
4f90: 20 6d 6f 6e 74 68 20 6f 72 20 64 61 79 20 6f 66   month or day of
4fa0: 20 74 68 65 20 77 65 65 6b 2c 20 74 68 65 20 64   the week, the d
4fb0: 61 79 20 6f 66 20 74 68 65 20 6d 6f 6e 74 68 20  ay of the month 
4fc0: 6f 72 20 64 61 79 20 6f 66 20 74 68 65 20 77 65  or day of the we
4fd0: 65 6b 0a 61 72 65 20 75 73 65 64 20 74 6f 20 64  ek.are used to d
4fe0: 65 74 65 72 6d 69 6e 65 20 74 68 65 20 64 61 74  etermine the dat
4ff0: 65 20 62 79 20 69 6e 74 65 72 70 72 65 74 69 6e  e by interpretin
5000: 67 20 74 68 65 20 62 61 73 65 20 74 69 6d 65 20  g the base time 
5010: 69 6e 20 74 68 65 0a 67 69 76 65 6e 20 74 69 6d  in the.given tim
5020: 65 20 7a 6f 6e 65 20 61 6e 64 20 72 65 74 75 72  e zone and retur
5030: 6e 69 6e 67 20 74 68 65 20 67 69 76 65 6e 20 64  ning the given d
5040: 61 79 20 6f 66 20 74 68 65 20 63 75 72 72 65 6e  ay of the curren
5050: 74 20 77 65 65 6b 20 6f 72 20 6d 6f 6e 74 68 2e  t week or month.
5060: 0a 28 54 68 65 20 77 65 65 6b 20 72 75 6e 73 20  .(The week runs 
5070: 66 72 6f 6d 20 4d 6f 6e 64 61 79 20 74 6f 20 53  from Monday to S
5080: 75 6e 64 61 79 2c 20 49 53 4f 38 36 30 31 2d 66  unday, ISO8601-f
5090: 61 73 68 69 6f 6e 2e 29 20 20 49 66 20 62 6f 74  ashion.)  If bot
50a0: 68 20 64 61 79 0a 6f 66 20 6d 6f 6e 74 68 20 61  h day.of month a
50b0: 6e 64 20 64 61 79 20 6f 66 20 77 65 65 6b 20 61  nd day of week a
50c0: 72 65 20 70 72 65 73 65 6e 74 2c 20 74 68 65 20  re present, the 
50d0: 64 61 79 20 6f 66 20 74 68 65 20 6d 6f 6e 74 68  day of the month
50e0: 20 74 61 6b 65 73 0a 70 72 69 6f 72 69 74 79 2e   takes.priority.
50f0: 0a 2e 49 50 20 5b 37 5d 0a 49 66 20 6e 6f 6e 65  ..IP [7].If none
5100: 20 6f 66 20 74 68 65 20 61 62 6f 76 65 20 72 75   of the above ru
5110: 6c 65 73 20 72 65 73 75 6c 74 73 20 69 6e 20 61  les results in a
5120: 20 75 73 61 62 6c 65 20 64 61 74 65 2c 20 74 68   usable date, th
5130: 65 20 64 61 74 65 0a 6f 66 20 74 68 65 20 62 61  e date.of the ba
5140: 73 65 20 74 69 6d 65 20 69 6e 20 74 68 65 20 67  se time in the g
5150: 69 76 65 6e 20 74 69 6d 65 20 7a 6f 6e 65 20 69  iven time zone i
5160: 73 20 75 73 65 64 2e 0a 2e 50 50 0a 54 68 65 20  s used...PP.The 
5170: 74 69 6d 65 20 69 73 20 61 6c 73 6f 20 64 65 74  time is also det
5180: 65 72 6d 69 6e 65 64 20 61 63 63 6f 72 64 69 6e  ermined accordin
5190: 67 20 74 6f 20 74 68 65 20 66 69 65 6c 64 73 20  g to the fields 
51a0: 74 68 61 74 20 61 72 65 20 70 72 65 73 65 6e 74  that are present
51b0: 20 69 6e 20 74 68 65 0a 70 72 65 70 72 6f 63 65   in the.preproce
51c0: 73 73 65 64 20 66 6f 72 6d 61 74 20 73 74 72 69  ssed format stri
51d0: 6e 67 2e 20 20 49 6e 20 6f 72 64 65 72 20 6f 66  ng.  In order of
51e0: 20 70 72 65 66 65 72 65 6e 63 65 3a 0a 2e 49 50   preference:..IP
51f0: 20 5b 31 5d 0a 49 66 20 74 68 65 20 73 74 72 69   [1].If the stri
5200: 6e 67 20 63 6f 6e 74 61 69 6e 73 20 61 20 5c 66  ng contains a \f
5210: 42 25 73 5c 66 52 20 66 6f 72 6d 61 74 20 67 72  B%s\fR format gr
5220: 6f 75 70 2c 20 72 65 70 72 65 73 65 6e 74 69 6e  oup, representin
5230: 67 0a 73 65 63 6f 6e 64 73 20 66 72 6f 6d 20 74  g.seconds from t
5240: 68 65 20 65 70 6f 63 68 2c 20 74 68 61 74 20 67  he epoch, that g
5250: 72 6f 75 70 20 64 65 74 65 72 6d 69 6e 65 73 20  roup determines 
5260: 74 68 65 20 74 69 6d 65 20 6f 66 20 64 61 79 2e  the time of day.
5270: 0a 2e 49 50 20 5b 32 5d 0a 49 66 20 74 68 65 20  ..IP [2].If the 
5280: 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 73 20  string contains 
5290: 65 69 74 68 65 72 20 61 6e 20 68 6f 75 72 20 6f  either an hour o
52a0: 6e 20 74 68 65 20 32 34 2d 68 6f 75 72 20 63 6c  n the 24-hour cl
52b0: 6f 63 6b 0a 6f 72 20 61 6e 20 68 6f 75 72 20 6f  ock.or an hour o
52c0: 6e 20 74 68 65 20 31 32 2d 68 6f 75 72 20 63 6c  n the 12-hour cl
52d0: 6f 63 6b 20 70 6c 75 73 20 61 6e 20 41 4d 2f 50  ock plus an AM/P
52e0: 4d 20 69 6e 64 69 63 61 74 6f 72 2c 20 74 68 61  M indicator, tha
52f0: 74 20 68 6f 75 72 20 64 65 74 65 72 6d 69 6e 65  t hour determine
5300: 73 0a 74 68 65 20 68 6f 75 72 20 6f 66 20 74 68  s.the hour of th
5310: 65 20 64 61 79 2e 20 20 49 66 20 74 68 65 20 73  e day.  If the s
5320: 74 72 69 6e 67 20 66 75 72 74 68 65 72 20 63 6f  tring further co
5330: 6e 74 61 69 6e 73 20 61 20 67 72 6f 75 70 20 73  ntains a group s
5340: 70 65 63 69 66 79 69 6e 67 0a 74 68 65 20 6d 69  pecifying.the mi
5350: 6e 75 74 65 20 6f 66 20 74 68 65 20 68 6f 75 72  nute of the hour
5360: 2c 20 74 68 61 74 20 67 72 6f 75 70 20 63 6f 6d  , that group com
5370: 62 69 6e 65 73 20 77 69 74 68 20 74 68 65 20 68  bines with the h
5380: 6f 75 72 2e 20 20 49 66 20 74 68 65 20 73 74 72  our.  If the str
5390: 69 6e 67 0a 66 75 72 74 68 65 72 20 63 6f 6e 74  ing.further cont
53a0: 61 69 6e 73 20 61 20 67 72 6f 75 70 20 73 70 65  ains a group spe
53b0: 63 69 66 79 69 6e 67 20 74 68 65 20 73 65 63 6f  cifying the seco
53c0: 6e 64 20 6f 66 20 74 68 65 20 6d 69 6e 75 74 65  nd of the minute
53d0: 2c 20 74 68 61 74 20 67 72 6f 75 70 0a 63 6f 6d  , that group.com
53e0: 62 69 6e 65 73 20 77 69 74 68 20 74 68 65 20 68  bines with the h
53f0: 6f 75 72 20 61 6e 64 20 6d 69 6e 75 74 65 2e 0a  our and minute..
5400: 2e 49 50 20 5b 33 5d 0a 49 66 20 74 68 65 20 73  .IP [3].If the s
5410: 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 73 20 6e  tring contains n
5420: 65 69 74 68 65 72 20 61 20 5c 66 42 25 73 5c 66  either a \fB%s\f
5430: 52 20 66 6f 72 6d 61 74 20 67 72 6f 75 70 20 6e  R format group n
5440: 6f 72 0a 61 20 67 72 6f 75 70 20 73 70 65 63 69  or.a group speci
5450: 66 79 69 6e 67 20 74 68 65 20 68 6f 75 72 20 6f  fying the hour o
5460: 66 20 74 68 65 20 64 61 79 2c 20 74 68 65 6e 20  f the day, then 
5470: 6d 69 64 6e 69 67 68 74 20 28 5c 66 42 30 30 3a  midnight (\fB00:
5480: 30 30 5c 66 52 2c 20 74 68 65 20 73 74 61 72 74  00\fR, the start
5490: 0a 6f 66 20 74 68 65 20 67 69 76 65 6e 20 64 61  .of the given da
54a0: 74 65 29 20 69 73 20 75 73 65 64 2e 0a 54 68 65  te) is used..The
54b0: 20 74 69 6d 65 20 7a 6f 6e 65 20 69 73 20 64 65   time zone is de
54c0: 74 65 72 6d 69 6e 65 64 20 62 79 20 65 69 74 68  termined by eith
54d0: 65 72 20 74 68 65 20 5c 66 42 5c 2d 74 69 6d 65  er the \fB\-time
54e0: 7a 6f 6e 65 5c 66 52 20 6f 72 20 5c 66 42 5c 2d  zone\fR or \fB\-
54f0: 67 6d 74 5c 66 52 0a 6f 70 74 69 6f 6e 73 2c 20  gmt\fR.options, 
5500: 6f 72 20 62 79 20 75 73 69 6e 67 20 74 68 65 20  or by using the 
5510: 63 75 72 72 65 6e 74 20 74 69 6d 65 20 7a 6f 6e  current time zon
5520: 65 2e 0a 2e 50 50 0a 49 66 20 61 20 66 6f 72 6d  e...PP.If a form
5530: 61 74 20 73 74 72 69 6e 67 20 6c 61 63 6b 73 20  at string lacks 
5540: 61 20 5c 66 42 25 7a 5c 66 52 20 6f 72 20 5c 66  a \fB%z\fR or \f
5550: 42 25 5a 5c 66 52 20 66 6f 72 6d 61 74 20 67 72  B%Z\fR format gr
5560: 6f 75 70 2c 0a 69 74 20 69 73 20 70 6f 73 73 69  oup,.it is possi
5570: 62 6c 65 20 66 6f 72 20 74 68 65 20 74 69 6d 65  ble for the time
5580: 20 74 6f 20 62 65 20 61 6d 62 69 67 75 6f 75 73   to be ambiguous
5590: 20 62 65 63 61 75 73 65 20 69 74 20 61 70 70 65   because it appe
55a0: 61 72 73 20 74 77 69 63 65 0a 69 6e 20 74 68 65  ars twice.in the
55b0: 20 73 61 6d 65 20 64 61 79 2c 20 6f 6e 63 65 20   same day, once 
55c0: 77 69 74 68 6f 75 74 20 61 6e 64 20 6f 6e 63 65  without and once
55d0: 20 77 69 74 68 20 44 61 79 6c 69 67 68 74 20 53   with Daylight S
55e0: 61 76 69 6e 67 20 54 69 6d 65 2e 0a 49 66 20 74  aving Time..If t
55f0: 68 69 73 20 73 69 74 75 61 74 69 6f 6e 20 6f 63  his situation oc
5600: 63 75 72 73 2c 20 74 68 65 20 66 69 72 73 74 20  curs, the first 
5610: 6f 63 63 75 72 72 65 6e 63 65 20 6f 66 20 74 68  occurrence of th
5620: 65 20 74 69 6d 65 20 69 73 20 63 68 6f 73 65 6e  e time is chosen
5630: 2e 0a 28 46 6f 72 20 74 68 69 73 20 72 65 61 73  ..(For this reas
5640: 6f 6e 2c 20 69 74 20 69 73 20 77 69 73 65 20 74  on, it is wise t
5650: 6f 20 68 61 76 65 20 74 68 65 20 69 6e 70 75 74  o have the input
5660: 20 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 20   string contain 
5670: 74 68 65 0a 74 69 6d 65 20 7a 6f 6e 65 20 77 68  the.time zone wh
5680: 65 6e 20 63 6f 6e 76 65 72 74 69 6e 67 20 6c 6f  en converting lo
5690: 63 61 6c 20 74 69 6d 65 73 2e 20 20 54 68 69 73  cal times.  This
56a0: 20 63 61 76 65 61 74 20 64 6f 65 73 20 6e 6f 74   caveat does not
56b0: 20 61 70 70 6c 79 20 74 6f 0a 55 54 43 20 74 69   apply to.UTC ti
56c0: 6d 65 73 2e 29 0a 2e 50 50 0a 49 66 20 74 68 65  mes.)..PP.If the
56d0: 20 69 6e 74 65 72 70 72 65 74 61 74 69 6f 6e 20   interpretation 
56e0: 6f 66 20 74 68 65 20 67 72 6f 75 70 73 20 79 69  of the groups yi
56f0: 65 6c 64 73 20 61 6e 20 69 6d 70 6f 73 73 69 62  elds an impossib
5700: 6c 65 20 74 69 6d 65 20 62 65 63 61 75 73 65 0a  le time because.
5710: 61 20 66 69 65 6c 64 20 69 73 20 6f 75 74 20 6f  a field is out o
5720: 66 20 72 61 6e 67 65 2c 20 61 6e 20 65 78 63 65  f range, an exce
5730: 70 74 69 6f 6e 20 69 73 20 72 61 69 73 65 64 20  ption is raised 
5740: 69 66 20 74 68 65 20 5c 66 42 2d 76 61 6c 69 64  if the \fB-valid
5750: 61 74 65 5c 66 52 0a 6f 70 74 69 6f 6e 20 69 73  ate\fR.option is
5760: 20 6e 6f 74 20 70 72 65 73 65 6e 74 20 6f 72 20   not present or 
5770: 70 61 73 73 65 64 20 61 73 20 74 72 75 65 2e 20  passed as true. 
5780: 49 66 20 70 61 73 73 65 64 20 61 73 20 66 61 6c  If passed as fal
5790: 73 65 2c 0a 65 6e 6f 75 67 68 20 6f 66 20 74 68  se,.enough of th
57a0: 61 74 20 66 69 65 6c 64 27 73 20 75 6e 69 74 20  at field's unit 
57b0: 77 69 6c 6c 20 62 65 20 61 64 64 65 64 20 74 6f  will be added to
57c0: 0a 6f 72 20 73 75 62 74 72 61 63 74 65 64 20 66  .or subtracted f
57d0: 72 6f 6d 20 74 68 65 20 74 69 6d 65 20 74 6f 20  rom the time to 
57e0: 62 72 69 6e 67 20 69 74 20 69 6e 20 72 61 6e 67  bring it in rang
57f0: 65 2e 20 54 68 75 73 2c 20 69 66 20 61 74 74 65  e. Thus, if atte
5800: 6d 70 74 69 6e 67 20 74 6f 0a 73 63 61 6e 20 6f  mpting to.scan o
5810: 72 20 66 6f 72 6d 61 74 20 64 61 79 20 30 20 6f  r format day 0 o
5820: 66 20 74 68 65 20 6d 6f 6e 74 68 2c 20 6f 6e 65  f the month, one
5830: 20 64 61 79 20 77 69 6c 6c 20 62 65 20 73 75 62   day will be sub
5840: 74 72 61 63 74 65 64 20 66 72 6f 6d 20 64 61 79  tracted from day
5850: 0a 31 20 6f 66 20 74 68 65 20 6d 6f 6e 74 68 2c  .1 of the month,
5860: 20 79 69 65 6c 64 69 6e 67 20 74 68 65 20 6c 61   yielding the la
5870: 73 74 20 64 61 79 20 6f 66 20 74 68 65 20 70 72  st day of the pr
5880: 65 76 69 6f 75 73 20 6d 6f 6e 74 68 2e 0a 2e 50  evious month...P
5890: 50 0a 49 66 20 74 68 65 20 69 6e 74 65 72 70 72  P.If the interpr
58a0: 65 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 67  etation of the g
58b0: 72 6f 75 70 73 20 79 69 65 6c 64 73 20 61 6e 20  roups yields an 
58c0: 69 6d 70 6f 73 73 69 62 6c 65 20 74 69 6d 65 20  impossible time 
58d0: 62 65 63 61 75 73 65 0a 61 20 44 61 79 6c 69 67  because.a Daylig
58e0: 68 74 20 53 61 76 69 6e 67 20 54 69 6d 65 20 63  ht Saving Time c
58f0: 68 61 6e 67 65 20 73 6b 69 70 73 20 6f 76 65 72  hange skips over
5900: 20 74 68 61 74 20 74 69 6d 65 2c 20 6f 72 20 61   that time, or a
5910: 6e 20 61 6d 62 69 67 75 6f 75 73 0a 74 69 6d 65  n ambiguous.time
5920: 20 62 65 63 61 75 73 65 20 61 20 44 61 79 6c 69   because a Dayli
5930: 67 68 74 20 53 61 76 69 6e 67 20 54 69 6d 65 20  ght Saving Time 
5940: 63 68 61 6e 67 65 20 73 6b 69 70 73 20 62 61 63  change skips bac
5950: 6b 20 73 6f 20 74 68 61 74 20 74 68 65 20 63 6c  k so that the cl
5960: 6f 63 6b 0a 6f 62 73 65 72 76 65 73 20 74 68 65  ock.observes the
5970: 20 67 69 76 65 6e 20 74 69 6d 65 20 74 77 69 63   given time twic
5980: 65 2c 20 61 6e 64 20 6e 6f 20 74 69 6d 65 20 7a  e, and no time z
5990: 6f 6e 65 20 73 70 65 63 69 66 69 65 72 20 28 5c  one specifier (\
59a0: 66 42 25 7a 5c 66 52 0a 6f 72 20 5c 66 42 25 5a  fB%z\fR.or \fB%Z
59b0: 5c 66 52 29 20 69 73 20 70 72 65 73 65 6e 74 20  \fR) is present 
59c0: 69 6e 20 74 68 65 20 66 6f 72 6d 61 74 2c 20 74  in the format, t
59d0: 68 65 20 74 69 6d 65 20 69 73 20 69 6e 74 65 72  he time is inter
59e0: 70 72 65 74 65 64 20 61 73 0a 69 66 20 74 68 65  preted as.if the
59f0: 20 63 6c 6f 63 6b 20 68 61 64 20 6e 6f 74 20 63   clock had not c
5a00: 68 61 6e 67 65 64 2e 0a 2e 53 48 20 22 46 4f 52  hanged...SH "FOR
5a10: 4d 41 54 20 47 52 4f 55 50 53 22 0a 2e 50 50 0a  MAT GROUPS"..PP.
5a20: 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 66 6f  The following fo
5a30: 72 6d 61 74 20 67 72 6f 75 70 73 20 61 72 65 20  rmat groups are 
5a40: 72 65 63 6f 67 6e 69 7a 65 64 20 62 79 20 74 68  recognized by th
5a50: 65 20 5c 66 42 63 6c 6f 63 6b 20 73 63 61 6e 5c  e \fBclock scan\
5a60: 66 52 20 61 6e 64 0a 5c 66 42 63 6c 6f 63 6b 20  fR and.\fBclock 
5a70: 66 6f 72 6d 61 74 5c 66 52 20 63 6f 6d 6d 61 6e  format\fR comman
5a80: 64 73 2e 0a 2e 49 50 20 5c 66 42 25 61 5c 66 52  ds...IP \fB%a\fR
5a90: 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64  .On output, prod
5aa0: 75 63 65 73 20 61 6e 20 61 62 62 72 65 76 69 61  uces an abbrevia
5ab0: 74 69 6f 6e 20 28 5c 66 49 65 2e 67 2e 2c 20 5c  tion (\fIe.g., \
5ac0: 66 42 4d 6f 6e 5c 66 52 29 20 66 6f 72 20 74 68  fBMon\fR) for th
5ad0: 65 20 64 61 79 0a 6f 66 20 74 68 65 20 77 65 65  e day.of the wee
5ae0: 6b 20 69 6e 20 74 68 65 20 67 69 76 65 6e 20 6c  k in the given l
5af0: 6f 63 61 6c 65 2e 20 20 4f 6e 20 69 6e 70 75 74  ocale.  On input
5b00: 2c 20 6d 61 74 63 68 65 73 20 74 68 65 20 6e 61  , matches the na
5b10: 6d 65 20 6f 66 20 74 68 65 20 64 61 79 0a 6f 66  me of the day.of
5b20: 20 74 68 65 20 77 65 65 6b 20 69 6e 20 74 68 65   the week in the
5b30: 20 67 69 76 65 6e 20 6c 6f 63 61 6c 65 20 28 69   given locale (i
5b40: 6e 20 65 69 74 68 65 72 20 61 62 62 72 65 76 69  n either abbrevi
5b50: 61 74 65 64 20 6f 72 20 66 75 6c 6c 20 66 6f 72  ated or full for
5b60: 6d 2c 20 6f 72 0a 61 6e 79 20 75 6e 69 71 75 65  m, or.any unique
5b70: 20 70 72 65 66 69 78 20 6f 66 20 65 69 74 68 65   prefix of eithe
5b80: 72 20 66 6f 72 6d 29 2e 0a 2e 49 50 20 5c 66 42  r form)...IP \fB
5b90: 25 41 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c  %A\fR.On output,
5ba0: 20 70 72 6f 64 75 63 65 73 20 74 68 65 20 66 75   produces the fu
5bb0: 6c 6c 20 6e 61 6d 65 20 28 5c 66 49 65 2e 67 2e  ll name (\fIe.g.
5bc0: 2c 20 5c 66 42 4d 6f 6e 64 61 79 5c 66 52 29 20  , \fBMonday\fR) 
5bd0: 6f 66 20 74 68 65 20 64 61 79 0a 6f 66 20 74 68  of the day.of th
5be0: 65 20 77 65 65 6b 20 69 6e 20 74 68 65 20 67 69  e week in the gi
5bf0: 76 65 6e 20 6c 6f 63 61 6c 65 2e 20 20 4f 6e 20  ven locale.  On 
5c00: 69 6e 70 75 74 2c 20 6d 61 74 63 68 65 73 20 74  input, matches t
5c10: 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 64  he name of the d
5c20: 61 79 0a 6f 66 20 74 68 65 20 77 65 65 6b 20 69  ay.of the week i
5c30: 6e 20 74 68 65 20 67 69 76 65 6e 20 6c 6f 63 61  n the given loca
5c40: 6c 65 20 28 69 6e 20 65 69 74 68 65 72 20 61 62  le (in either ab
5c50: 62 72 65 76 69 61 74 65 64 20 6f 72 20 66 75 6c  breviated or ful
5c60: 6c 20 66 6f 72 6d 2c 20 6f 72 0a 61 6e 79 20 75  l form, or.any u
5c70: 6e 69 71 75 65 20 70 72 65 66 69 78 20 6f 66 20  nique prefix of 
5c80: 65 69 74 68 65 72 20 66 6f 72 6d 29 2e 0a 2e 49  either form)...I
5c90: 50 20 5c 66 42 25 62 5c 66 52 0a 4f 6e 20 6f 75  P \fB%b\fR.On ou
5ca0: 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61  tput, produces a
5cb0: 6e 20 61 62 62 72 65 76 69 61 74 69 6f 6e 20 28  n abbreviation (
5cc0: 5c 66 49 65 2e 67 2e 2c 20 5c 66 42 4a 61 6e 5c  \fIe.g., \fBJan\
5cd0: 66 52 29 20 66 6f 72 20 74 68 65 20 6e 61 6d 65  fR) for the name
5ce0: 0a 6f 66 20 74 68 65 20 6d 6f 6e 74 68 20 69 6e  .of the month in
5cf0: 20 74 68 65 20 67 69 76 65 6e 20 6c 6f 63 61 6c   the given local
5d00: 65 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20 6d 61  e.  On input, ma
5d10: 74 63 68 65 73 20 74 68 65 20 6e 61 6d 65 20 6f  tches the name o
5d20: 66 20 74 68 65 20 6d 6f 6e 74 68 0a 69 6e 20 74  f the month.in t
5d30: 68 65 20 67 69 76 65 6e 20 6c 6f 63 61 6c 65 20  he given locale 
5d40: 28 69 6e 20 65 69 74 68 65 72 20 61 62 62 72 65  (in either abbre
5d50: 76 69 61 74 65 64 20 6f 72 20 66 75 6c 6c 20 66  viated or full f
5d60: 6f 72 6d 2c 20 6f 72 0a 61 6e 79 20 75 6e 69 71  orm, or.any uniq
5d70: 75 65 20 70 72 65 66 69 78 20 6f 66 20 65 69 74  ue prefix of eit
5d80: 68 65 72 20 66 6f 72 6d 29 2e 0a 2e 49 50 20 5c  her form)...IP \
5d90: 66 42 25 42 5c 66 52 0a 4f 6e 20 6f 75 74 70 75  fB%B\fR.On outpu
5da0: 74 2c 20 70 72 6f 64 75 63 65 73 20 74 68 65 20  t, produces the 
5db0: 66 75 6c 6c 20 6e 61 6d 65 20 28 5c 66 49 65 2e  full name (\fIe.
5dc0: 67 2e 2c 20 5c 66 42 4a 61 6e 75 61 72 79 5c 66  g., \fBJanuary\f
5dd0: 52 29 0a 6f 66 20 74 68 65 20 6d 6f 6e 74 68 20  R).of the month 
5de0: 69 6e 20 74 68 65 20 67 69 76 65 6e 20 6c 6f 63  in the given loc
5df0: 61 6c 65 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20  ale.  On input, 
5e00: 6d 61 74 63 68 65 73 20 74 68 65 20 6e 61 6d 65  matches the name
5e10: 20 6f 66 20 74 68 65 20 6d 6f 6e 74 68 0a 69 6e   of the month.in
5e20: 20 74 68 65 20 67 69 76 65 6e 20 6c 6f 63 61 6c   the given local
5e30: 65 20 28 69 6e 20 65 69 74 68 65 72 20 61 62 62  e (in either abb
5e40: 72 65 76 69 61 74 65 64 20 6f 72 20 66 75 6c 6c  reviated or full
5e50: 20 66 6f 72 6d 2c 20 6f 72 0a 61 6e 79 20 75 6e   form, or.any un
5e60: 69 71 75 65 20 70 72 65 66 69 78 20 6f 66 20 65  ique prefix of e
5e70: 69 74 68 65 72 20 66 6f 72 6d 29 2e 0a 2e 49 50  ither form)...IP
5e80: 20 5c 66 42 25 63 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%c\fR.On out
5e90: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20  put, produces a 
5ea0: 6c 6f 63 61 6c 69 7a 65 64 20 72 65 70 72 65 73  localized repres
5eb0: 65 6e 74 61 74 69 6f 6e 20 6f 66 20 64 61 74 65  entation of date
5ec0: 20 61 6e 64 20 74 69 6d 65 20 6f 66 20 64 61 79   and time of day
5ed0: 3b 0a 74 68 65 20 6c 6f 63 61 6c 69 7a 65 64 20  ;.the localized 
5ee0: 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 69  representation i
5ef0: 73 20 65 78 70 65 63 74 65 64 20 74 6f 20 75 73  s expected to us
5f00: 65 20 74 68 65 20 47 72 65 67 6f 72 69 61 6e 20  e the Gregorian 
5f10: 63 61 6c 65 6e 64 61 72 2e 0a 4f 6e 20 69 6e 70  calendar..On inp
5f20: 75 74 2c 20 6d 61 74 63 68 65 73 20 77 68 61 74  ut, matches what
5f30: 65 76 65 72 20 5c 66 42 25 63 5c 66 52 20 70 72  ever \fB%c\fR pr
5f40: 6f 64 75 63 65 73 2e 0a 2e 49 50 20 5c 66 42 25  oduces...IP \fB%
5f50: 43 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20  C\fR.On output, 
5f60: 70 72 6f 64 75 63 65 73 20 74 68 65 20 6e 75 6d  produces the num
5f70: 62 65 72 20 6f 66 20 74 68 65 20 63 65 6e 74 75  ber of the centu
5f80: 72 79 20 69 6e 20 49 6e 64 6f 2d 41 72 61 62 69  ry in Indo-Arabi
5f90: 63 20 6e 75 6d 65 72 61 6c 73 2e 0a 4f 6e 20 69  c numerals..On i
5fa0: 6e 70 75 74 2c 20 6d 61 74 63 68 65 73 20 6f 6e  nput, matches on
5fb0: 65 20 6f 72 20 74 77 6f 20 64 69 67 69 74 73 2c  e or two digits,
5fc0: 20 70 6f 73 73 69 62 6c 79 20 77 69 74 68 20 6c   possibly with l
5fd0: 65 61 64 69 6e 67 20 77 68 69 74 65 73 70 61 63  eading whitespac
5fe0: 65 2c 0a 74 68 61 74 20 61 72 65 20 65 78 70 65  e,.that are expe
5ff0: 63 74 65 64 20 74 6f 20 62 65 20 74 68 65 20 6e  cted to be the n
6000: 75 6d 62 65 72 20 6f 66 20 74 68 65 20 63 65 6e  umber of the cen
6010: 74 75 72 79 2e 0a 2e 49 50 20 5c 66 42 25 64 5c  tury...IP \fB%d\
6020: 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72  fR.On output, pr
6030: 6f 64 75 63 65 73 20 74 68 65 20 6e 75 6d 62 65  oduces the numbe
6040: 72 20 6f 66 20 74 68 65 20 64 61 79 20 6f 66 20  r of the day of 
6050: 74 68 65 20 6d 6f 6e 74 68 2c 20 61 73 20 74 77  the month, as tw
6060: 6f 20 64 65 63 69 6d 61 6c 0a 64 69 67 69 74 73  o decimal.digits
6070: 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74  .  On input, mat
6080: 63 68 65 73 20 6f 6e 65 20 6f 72 20 74 77 6f 20  ches one or two 
6090: 64 69 67 69 74 73 2c 20 70 6f 73 73 69 62 6c 79  digits, possibly
60a0: 20 77 69 74 68 20 6c 65 61 64 69 6e 67 0a 77 68   with leading.wh
60b0: 69 74 65 73 70 61 63 65 2c 20 74 68 61 74 20 61  itespace, that a
60c0: 72 65 20 65 78 70 65 63 74 65 64 20 74 6f 20 62  re expected to b
60d0: 65 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20  e the number of 
60e0: 74 68 65 20 64 61 79 20 6f 66 20 74 68 65 20 6d  the day of the m
60f0: 6f 6e 74 68 2e 0a 2e 49 50 20 5c 66 42 25 44 5c  onth...IP \fB%D\
6100: 66 52 0a 54 68 69 73 20 66 6f 72 6d 61 74 20 67  fR.This format g
6110: 72 6f 75 70 20 69 73 20 73 79 6e 6f 6e 79 6d 6f  roup is synonymo
6120: 75 73 20 77 69 74 68 20 5c 66 42 25 6d 2f 25 64  us with \fB%m/%d
6130: 2f 25 59 5c 66 52 2e 20 20 49 74 20 73 68 6f 75  /%Y\fR.  It shou
6140: 6c 64 20 62 65 0a 75 73 65 64 20 6f 6e 6c 79 20  ld be.used only 
6150: 69 6e 20 65 78 63 68 61 6e 67 69 6e 67 20 64 61  in exchanging da
6160: 74 61 20 77 69 74 68 69 6e 20 74 68 65 20 5c 66  ta within the \f
6170: 42 65 6e 5f 55 53 5c 66 52 20 6c 6f 63 61 6c 65  Ben_US\fR locale
6180: 2c 20 73 69 6e 63 65 0a 6f 74 68 65 72 20 6c 6f  , since.other lo
6190: 63 61 6c 65 73 20 74 79 70 69 63 61 6c 6c 79 20  cales typically 
61a0: 64 6f 20 6e 6f 74 20 75 73 65 20 74 68 69 73 20  do not use this 
61b0: 6f 72 64 65 72 20 66 6f 72 20 74 68 65 20 66 69  order for the fi
61c0: 65 6c 64 73 20 6f 66 20 74 68 65 20 64 61 74 65  elds of the date
61d0: 2e 0a 2e 49 50 20 5c 66 42 25 65 5c 66 52 0a 4f  ...IP \fB%e\fR.O
61e0: 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63  n output, produc
61f0: 65 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66  es the number of
6200: 20 74 68 65 20 64 61 79 20 6f 66 20 74 68 65 20   the day of the 
6210: 6d 6f 6e 74 68 2c 20 61 73 20 6f 6e 65 20 6f 72  month, as one or
6220: 0a 74 77 6f 20 64 65 63 69 6d 61 6c 20 64 69 67  .two decimal dig
6230: 69 74 73 20 28 77 69 74 68 20 61 20 6c 65 61 64  its (with a lead
6240: 69 6e 67 20 62 6c 61 6e 6b 20 66 6f 72 20 6f 6e  ing blank for on
6250: 65 2d 64 69 67 69 74 20 64 61 74 65 73 29 2e 0a  e-digit dates)..
6260: 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74 63 68 65  On input, matche
6270: 73 20 6f 6e 65 20 6f 72 20 74 77 6f 20 64 69 67  s one or two dig
6280: 69 74 73 2c 20 70 6f 73 73 69 62 6c 79 20 77 69  its, possibly wi
6290: 74 68 20 6c 65 61 64 69 6e 67 0a 77 68 69 74 65  th leading.white
62a0: 73 70 61 63 65 2c 20 74 68 61 74 20 61 72 65 20  space, that are 
62b0: 65 78 70 65 63 74 65 64 20 74 6f 20 62 65 20 74  expected to be t
62c0: 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65  he number of the
62d0: 20 64 61 79 20 6f 66 20 74 68 65 20 6d 6f 6e 74   day of the mont
62e0: 68 2e 0a 2e 49 50 20 5c 66 42 25 45 63 5c 66 52  h...IP \fB%Ec\fR
62f0: 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64  .On output, prod
6300: 75 63 65 73 20 61 20 6c 6f 63 61 6c 65 2d 64 65  uces a locale-de
6310: 70 65 6e 64 65 6e 74 20 72 65 70 72 65 73 65 6e  pendent represen
6320: 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 64 61  tation of the da
6330: 74 65 20 61 6e 64 0a 74 69 6d 65 20 6f 66 20 64  te and.time of d
6340: 61 79 20 69 6e 20 74 68 65 20 6c 6f 63 61 6c 65  ay in the locale
6350: 27 73 20 61 6c 74 65 72 6e 61 74 69 76 65 20 63  's alternative c
6360: 61 6c 65 6e 64 61 72 2e 20 20 4f 6e 20 69 6e 70  alendar.  On inp
6370: 75 74 2c 20 6d 61 74 63 68 65 73 0a 77 68 61 74  ut, matches.what
6380: 65 76 65 72 20 5c 66 42 25 45 63 5c 66 52 20 70  ever \fB%Ec\fR p
6390: 72 6f 64 75 63 65 73 2e 20 20 54 68 65 20 6c 6f  roduces.  The lo
63a0: 63 61 6c 65 27 73 20 61 6c 74 65 72 6e 61 74 69  cale's alternati
63b0: 76 65 20 63 61 6c 65 6e 64 61 72 20 6e 65 65 64  ve calendar need
63c0: 20 6e 6f 74 0a 62 65 20 74 68 65 20 47 72 65 67   not.be the Greg
63d0: 6f 72 69 61 6e 20 63 61 6c 65 6e 64 61 72 2e 0a  orian calendar..
63e0: 2e 49 50 20 5c 66 42 25 45 43 5c 66 52 0a 4f 6e  .IP \fB%EC\fR.On
63f0: 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65   output, produce
6400: 73 20 61 20 6c 6f 63 61 6c 65 2d 64 65 70 65 6e  s a locale-depen
6410: 64 65 6e 74 20 6e 61 6d 65 20 6f 66 20 61 6e 20  dent name of an 
6420: 65 72 61 20 69 6e 20 74 68 65 20 6c 6f 63 61 6c  era in the local
6430: 65 27 73 0a 61 6c 74 65 72 6e 61 74 69 76 65 20  e's.alternative 
6440: 63 61 6c 65 6e 64 61 72 2e 20 20 4f 6e 20 69 6e  calendar.  On in
6450: 70 75 74 2c 20 6d 61 74 63 68 65 73 20 74 68 65  put, matches the
6460: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 65 72 61   name of the era
6470: 20 6f 72 20 61 6e 79 0a 75 6e 69 71 75 65 20 70   or any.unique p
6480: 72 65 66 69 78 2e 0a 2e 49 50 20 5c 66 42 25 45  refix...IP \fB%E
6490: 45 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20  E\fR.On output, 
64a0: 70 72 6f 64 75 63 65 73 20 74 68 65 20 73 74 72  produces the str
64b0: 69 6e 67 20 5c 66 42 42 2e 43 2e 45 2e 5c 66 52  ing \fBB.C.E.\fR
64c0: 20 6f 72 20 5c 66 42 43 2e 45 2e 5c 66 52 2c 20   or \fBC.E.\fR, 
64d0: 6f 72 20 61 0a 73 74 72 69 6e 67 20 6f 66 20 74  or a.string of t
64e0: 68 65 20 73 61 6d 65 20 6d 65 61 6e 69 6e 67 20  he same meaning 
64f0: 69 6e 20 74 68 65 20 6c 6f 63 61 6c 65 2c 20 74  in the locale, t
6500: 6f 20 69 6e 64 69 63 61 74 65 20 77 68 65 74 68  o indicate wheth
6510: 65 72 20 5c 66 42 25 59 5c 66 52 20 72 65 66 65  er \fB%Y\fR refe
6520: 72 73 0a 74 6f 20 79 65 61 72 73 20 62 65 66 6f  rs.to years befo
6530: 72 65 20 6f 72 20 61 66 74 65 72 20 59 65 61 72  re or after Year
6540: 20 31 20 6f 66 20 74 68 65 20 43 6f 6d 6d 6f 6e   1 of the Common
6550: 20 45 72 61 2e 20 20 4f 6e 20 69 6e 70 75 74 2c   Era.  On input,
6560: 20 61 63 63 65 70 74 73 0a 74 68 65 20 73 74 72   accepts.the str
6570: 69 6e 67 20 5c 66 42 42 2e 43 2e 45 2e 5c 66 52  ing \fBB.C.E.\fR
6580: 2c 20 5c 66 42 42 2e 43 2e 5c 66 52 2c 20 5c 66  , \fBB.C.\fR, \f
6590: 42 43 2e 45 2e 5c 66 52 2c 20 5c 66 42 41 2e 44  BC.E.\fR, \fBA.D
65a0: 2e 5c 66 52 2c 20 6f 72 20 74 68 65 0a 61 62 62  .\fR, or the.abb
65b0: 72 65 76 69 61 74 69 6f 6e 20 61 70 70 72 6f 70  reviation approp
65c0: 72 69 61 74 65 20 74 6f 20 74 68 65 20 63 75 72  riate to the cur
65d0: 72 65 6e 74 20 6c 6f 63 61 6c 65 2c 20 61 6e 64  rent locale, and
65e0: 20 75 73 65 73 20 69 74 20 74 6f 20 66 69 78 0a   uses it to fix.
65f0: 77 68 65 74 68 65 72 20 5c 66 42 25 59 5c 66 52  whether \fB%Y\fR
6600: 20 72 65 66 65 72 73 20 74 6f 20 79 65 61 72 73   refers to years
6610: 20 62 65 66 6f 72 65 20 6f 72 20 61 66 74 65 72   before or after
6620: 20 59 65 61 72 20 31 20 6f 66 20 74 68 65 0a 43   Year 1 of the.C
6630: 6f 6d 6d 6f 6e 20 45 72 61 2e 0a 2e 49 50 20 5c  ommon Era...IP \
6640: 66 42 25 45 6a 5c 66 52 0a 4f 6e 20 6f 75 74 70  fB%Ej\fR.On outp
6650: 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20 73  ut, produces a s
6660: 74 72 69 6e 67 20 6f 66 20 64 69 67 69 74 73 20  tring of digits 
6670: 67 69 76 69 6e 67 20 74 68 65 20 41 73 74 72 6f  giving the Astro
6680: 6e 6f 6d 69 63 61 6c 20 4a 75 6c 69 61 6e 20 44  nomical Julian D
6690: 61 74 65 20 6f 72 0a 41 73 74 72 6f 6e 6f 6d 69  ate or.Astronomi
66a0: 63 61 6c 20 4a 75 6c 69 61 6e 20 44 61 79 20 4e  cal Julian Day N
66b0: 75 6d 62 65 72 20 28 4a 44 4e 2f 4a 44 29 2e 20  umber (JDN/JD). 
66c0: 49 6e 20 6f 70 70 6f 73 69 74 65 20 74 6f 20 63  In opposite to c
66d0: 61 6c 65 6e 64 61 72 20 6a 75 6c 69 61 6e 20 64  alendar julian d
66e0: 61 79 0a 5c 66 42 25 4a 5c 66 52 2c 20 69 74 20  ay.\fB%J\fR, it 
66f0: 73 74 61 72 74 73 20 74 68 65 20 64 61 79 20 61  starts the day a
6700: 74 20 6e 6f 6f 6e 2e 0a 4f 6e 20 69 6e 70 75 74  t noon..On input
6710: 2c 20 61 63 63 65 70 74 73 20 61 20 73 74 72 69  , accepts a stri
6720: 6e 67 20 6f 66 20 64 69 67 69 74 73 20 28 6f 72  ng of digits (or
6730: 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69 6e 74 20   floating point 
6740: 77 69 74 68 20 74 68 65 20 74 69 6d 65 20 66 72  with the time fr
6750: 61 63 74 69 6f 6e 29 0a 61 6e 64 20 69 6e 74 65  action).and inte
6760: 72 70 72 65 74 73 20 69 74 20 61 73 20 61 6e 20  rprets it as an 
6770: 41 73 74 72 6f 6e 6f 6d 69 63 61 6c 20 4a 75 6c  Astronomical Jul
6780: 69 61 6e 20 44 61 79 20 4e 75 6d 62 65 72 20 28  ian Day Number (
6790: 4a 44 4e 2f 4a 44 29 2e 0a 54 68 65 20 41 73 74  JDN/JD)..The Ast
67a0: 72 6f 6e 6f 6d 69 63 61 6c 20 4a 75 6c 69 61 6e  ronomical Julian
67b0: 20 44 61 74 65 20 69 73 20 61 20 63 6f 75 6e 74   Date is a count
67c0: 20 6f 66 20 74 68 65 20 6e 75 6d 62 65 72 20 6f   of the number o
67d0: 66 20 63 61 6c 65 6e 64 61 72 20 64 61 79 73 0a  f calendar days.
67e0: 74 68 61 74 20 68 61 76 65 20 65 6c 61 70 73 65  that have elapse
67f0: 64 20 73 69 6e 63 65 20 31 20 4a 61 6e 75 61 72  d since 1 Januar
6800: 79 2c 20 34 37 31 33 20 42 43 45 20 6f 66 20 74  y, 4713 BCE of t
6810: 68 65 20 70 72 6f 6c 65 70 74 69 63 0a 4a 75 6c  he proleptic.Jul
6820: 69 61 6e 20 63 61 6c 65 6e 64 61 72 2c 20 77 68  ian calendar, wh
6830: 69 63 68 20 63 6f 6e 74 61 69 6e 73 20 61 6c 73  ich contains als
6840: 6f 20 74 68 65 20 74 69 6d 65 20 66 72 61 6b 74  o the time frakt
6850: 69 6f 6e 20 28 61 66 74 65 72 20 66 6c 6f 61 74  ion (after float
6860: 69 6e 67 20 70 6f 69 6e 74 29 2e 0a 54 68 65 20  ing point)..The 
6870: 65 70 6f 63 68 20 74 69 6d 65 20 6f 66 20 31 20  epoch time of 1 
6880: 4a 61 6e 75 61 72 79 20 31 39 37 30 20 63 6f 72  January 1970 cor
6890: 72 65 73 70 6f 6e 64 73 20 74 6f 20 41 73 74 72  responds to Astr
68a0: 6f 6e 6f 6d 69 63 61 6c 20 4a 44 4e 20 32 34 34  onomical JDN 244
68b0: 30 35 38 37 2e 35 2e 0a 54 68 69 73 20 76 61 6c  0587.5..This val
68c0: 75 65 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74  ue corresponds t
68d0: 68 65 20 6a 75 6c 69 61 6e 20 64 61 79 20 75 73  he julian day us
68e0: 65 64 20 69 6e 20 73 71 6c 69 74 65 2d 64 61 74  ed in sqlite-dat
68f0: 61 62 61 73 65 2c 20 61 6e 64 20 69 73 20 74 68  abase, and is th
6900: 65 20 73 61 6d 65 0a 61 73 20 72 65 73 75 6c 74  e same.as result
6910: 20 6f 66 20 5c 66 42 73 65 6c 65 63 74 20 6a 75   of \fBselect ju
6920: 6c 69 61 6e 64 61 79 28 3a 73 65 63 6f 6e 64 73  lianday(:seconds
6930: 2c 20 27 75 6e 69 78 65 70 6f 63 68 27 29 5c 66  , 'unixepoch')\f
6940: 52 2e 0a 2e 49 50 20 5c 66 42 25 45 4a 5c 66 52  R...IP \fB%EJ\fR
6950: 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64  .On output, prod
6960: 75 63 65 73 20 61 20 73 74 72 69 6e 67 20 6f 66  uces a string of
6970: 20 64 69 67 69 74 73 20 67 69 76 69 6e 67 20 74   digits giving t
6980: 68 65 20 43 61 6c 65 6e 64 61 72 20 4a 75 6c 69  he Calendar Juli
6990: 61 6e 20 44 61 74 65 2e 0a 49 6e 20 6f 70 70 6f  an Date..In oppo
69a0: 73 69 74 65 20 74 6f 20 6a 75 6c 69 61 6e 20 64  site to julian d
69b0: 61 79 20 5c 66 42 25 4a 5c 66 52 20 66 6f 72 6d  ay \fB%J\fR form
69c0: 61 74 20 67 72 6f 75 70 2c 20 69 74 20 70 72 6f  at group, it pro
69d0: 64 75 63 65 73 20 66 6c 6f 61 74 20 6e 75 6d 62  duces float numb
69e0: 65 72 2e 0a 49 6e 20 6f 70 70 6f 73 69 74 65 20  er..In opposite 
69f0: 74 6f 20 61 73 74 72 6f 6e 6f 6d 69 63 61 6c 20  to astronomical 
6a00: 6a 75 6c 69 61 6e 20 64 61 79 20 5c 66 42 25 45  julian day \fB%E
6a10: 6a 5c 66 52 20 67 72 6f 75 70 2c 20 69 74 20 73  j\fR group, it s
6a20: 74 61 72 74 73 20 61 74 20 6d 69 64 6e 69 67 68  tarts at midnigh
6a30: 74 2e 0a 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63  t..On input, acc
6a40: 65 70 74 73 20 61 20 73 74 72 69 6e 67 20 6f 66  epts a string of
6a50: 20 64 69 67 69 74 73 20 28 6f 72 20 66 6c 6f 61   digits (or floa
6a60: 74 69 6e 67 20 70 6f 69 6e 74 20 77 69 74 68 20  ting point with 
6a70: 74 68 65 20 74 69 6d 65 20 66 72 61 63 74 69 6f  the time fractio
6a80: 6e 29 0a 61 6e 64 20 69 6e 74 65 72 70 72 65 74  n).and interpret
6a90: 73 20 69 74 20 61 73 20 61 20 43 61 6c 65 6e 64  s it as a Calend
6aa0: 61 72 20 4a 75 6c 69 61 6e 20 44 61 79 20 4e 75  ar Julian Day Nu
6ab0: 6d 62 65 72 2e 0a 54 68 65 20 43 61 6c 65 6e 64  mber..The Calend
6ac0: 61 72 20 4a 75 6c 69 61 6e 20 44 61 74 65 20 69  ar Julian Date i
6ad0: 73 20 61 20 63 6f 75 6e 74 20 6f 66 20 74 68 65  s a count of the
6ae0: 20 6e 75 6d 62 65 72 20 6f 66 20 63 61 6c 65 6e   number of calen
6af0: 64 61 72 20 64 61 79 73 0a 74 68 61 74 20 68 61  dar days.that ha
6b00: 76 65 20 65 6c 61 70 73 65 64 20 73 69 6e 63 65  ve elapsed since
6b10: 20 31 20 4a 61 6e 75 61 72 79 2c 20 34 37 31 33   1 January, 4713
6b20: 20 42 43 45 20 6f 66 20 74 68 65 20 70 72 6f 6c   BCE of the prol
6b30: 65 70 74 69 63 0a 4a 75 6c 69 61 6e 20 63 61 6c  eptic.Julian cal
6b40: 65 6e 64 61 72 2c 20 77 68 69 63 68 20 63 6f 6e  endar, which con
6b50: 74 61 69 6e 73 20 61 6c 73 6f 20 74 68 65 20 74  tains also the t
6b60: 69 6d 65 20 66 72 61 6b 74 69 6f 6e 20 28 61 66  ime fraktion (af
6b70: 74 65 72 20 66 6c 6f 61 74 69 6e 67 20 70 6f 69  ter floating poi
6b80: 6e 74 29 2e 0a 54 68 65 20 65 70 6f 63 68 20 74  nt)..The epoch t
6b90: 69 6d 65 20 6f 66 20 31 20 4a 61 6e 75 61 72 79  ime of 1 January
6ba0: 20 31 39 37 30 20 63 6f 72 72 65 73 70 6f 6e 64   1970 correspond
6bb0: 73 20 74 6f 20 41 73 74 72 6f 6e 6f 6d 69 63 61  s to Astronomica
6bc0: 6c 20 4a 44 4e 20 32 34 34 30 35 38 38 2e 0a 2e  l JDN 2440588...
6bd0: 49 50 20 5c 66 42 25 45 73 5c 66 52 0a 54 68 69  IP \fB%Es\fR.Thi
6be0: 73 20 61 66 66 65 63 74 73 20 73 69 6d 69 6c 61  s affects simila
6bf0: 72 20 74 6f 20 5c 66 42 25 73 5c 66 52 2c 20 62  r to \fB%s\fR, b
6c00: 75 74 20 69 6e 20 6f 70 70 6f 73 69 74 69 6f 6e  ut in opposition
6c10: 20 74 6f 20 5c 66 42 25 73 5c 66 52 20 69 74 20   to \fB%s\fR it 
6c20: 70 61 72 73 65 73 0a 6f 72 20 66 6f 72 6d 61 74  parses.or format
6c30: 73 20 6c 6f 63 61 6c 20 73 65 63 6f 6e 64 73 20  s local seconds 
6c40: 28 6e 6f 74 20 74 68 65 20 70 6f 73 69 78 20 73  (not the posix s
6c50: 65 63 6f 6e 64 73 29 2e 0a 42 65 63 61 75 73 65  econds)..Because
6c60: 20 5c 66 42 25 73 5c 66 52 20 68 61 73 20 74 68   \fB%s\fR has th
6c70: 65 20 73 61 6d 65 20 70 72 65 63 65 64 65 6e 63  e same precedenc
6c80: 65 20 61 73 20 5c 66 42 25 73 5c 66 52 20 28 75  e as \fB%s\fR (u
6c90: 6e 69 71 75 65 6c 79 20 64 65 74 65 72 6d 69 6e  niquely determin
6ca0: 65 73 0a 61 20 70 6f 69 6e 74 20 69 6e 20 74 69  es.a point in ti
6cb0: 6d 65 29 2c 20 69 74 20 6f 76 65 72 72 69 64 65  me), it override
6cc0: 73 20 61 6c 6c 20 6f 74 68 65 72 20 69 6e 70 75  s all other inpu
6cd0: 74 20 66 6f 72 6d 61 74 73 2e 0a 2e 49 50 20 5c  t formats...IP \
6ce0: 66 42 25 45 78 5c 66 52 0a 4f 6e 20 6f 75 74 70  fB%Ex\fR.On outp
6cf0: 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20 6c  ut, produces a l
6d00: 6f 63 61 6c 65 2d 64 65 70 65 6e 64 65 6e 74 20  ocale-dependent 
6d10: 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f  representation o
6d20: 66 20 74 68 65 20 64 61 74 65 0a 69 6e 20 74 68  f the date.in th
6d30: 65 20 6c 6f 63 61 6c 65 27 73 20 61 6c 74 65 72  e locale's alter
6d40: 6e 61 74 69 76 65 20 63 61 6c 65 6e 64 61 72 2e  native calendar.
6d50: 20 20 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74 63    On input, matc
6d60: 68 65 73 0a 77 68 61 74 65 76 65 72 20 5c 66 42  hes.whatever \fB
6d70: 25 45 78 5c 66 52 20 70 72 6f 64 75 63 65 73 2e  %Ex\fR produces.
6d80: 20 20 54 68 65 20 6c 6f 63 61 6c 65 27 73 20 61    The locale's a
6d90: 6c 74 65 72 6e 61 74 69 76 65 20 63 61 6c 65 6e  lternative calen
6da0: 64 61 72 20 6e 65 65 64 20 6e 6f 74 0a 62 65 20  dar need not.be 
6db0: 74 68 65 20 47 72 65 67 6f 72 69 61 6e 20 63 61  the Gregorian ca
6dc0: 6c 65 6e 64 61 72 2e 0a 2e 49 50 20 5c 66 42 25  lendar...IP \fB%
6dd0: 45 58 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c  EX\fR.On output,
6de0: 20 70 72 6f 64 75 63 65 73 20 61 20 6c 6f 63 61   produces a loca
6df0: 6c 65 2d 64 65 70 65 6e 64 65 6e 74 20 72 65 70  le-dependent rep
6e00: 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74  resentation of t
6e10: 68 65 0a 74 69 6d 65 20 6f 66 20 64 61 79 20 69  he.time of day i
6e20: 6e 20 74 68 65 20 6c 6f 63 61 6c 65 27 73 20 61  n the locale's a
6e30: 6c 74 65 72 6e 61 74 69 76 65 20 6e 75 6d 65 72  lternative numer
6e40: 61 6c 73 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20  als.  On input, 
6e50: 6d 61 74 63 68 65 73 0a 77 68 61 74 65 76 65 72  matches.whatever
6e60: 20 5c 66 42 25 45 58 5c 66 52 20 70 72 6f 64 75   \fB%EX\fR produ
6e70: 63 65 73 2e 0a 2e 49 50 20 5c 66 42 25 45 79 5c  ces...IP \fB%Ey\
6e80: 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72  fR.On output, pr
6e90: 6f 64 75 63 65 73 20 61 20 6c 6f 63 61 6c 65 2d  oduces a locale-
6ea0: 64 65 70 65 6e 64 65 6e 74 20 6e 75 6d 62 65 72  dependent number
6eb0: 20 6f 66 20 74 68 65 20 79 65 61 72 20 6f 66 20   of the year of 
6ec0: 74 68 65 20 65 72 61 0a 69 6e 20 74 68 65 20 6c  the era.in the l
6ed0: 6f 63 61 6c 65 27 73 20 61 6c 74 65 72 6e 61 74  ocale's alternat
6ee0: 69 76 65 20 63 61 6c 65 6e 64 61 72 20 61 6e 64  ive calendar and
6ef0: 20 6e 75 6d 65 72 61 6c 73 2e 20 20 4f 6e 20 69   numerals.  On i
6f00: 6e 70 75 74 2c 20 6d 61 74 63 68 65 73 0a 73 75  nput, matches.su
6f10: 63 68 20 61 20 6e 75 6d 62 65 72 2e 0a 2e 49 50  ch a number...IP
6f20: 20 5c 66 42 25 45 59 5c 66 52 0a 4f 6e 20 6f 75   \fB%EY\fR.On ou
6f30: 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61  tput, produces a
6f40: 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20   representation 
6f50: 6f 66 20 74 68 65 20 79 65 61 72 20 69 6e 20 74  of the year in t
6f60: 68 65 20 6c 6f 63 61 6c 65 27 73 0a 61 6c 74 65  he locale's.alte
6f70: 72 6e 61 74 69 76 65 20 63 61 6c 65 6e 64 61 72  rnative calendar
6f80: 20 61 6e 64 20 6e 75 6d 65 72 61 6c 73 2e 20 20   and numerals.  
6f90: 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74 63 68 65  On input, matche
6fa0: 73 20 77 68 61 74 20 5c 66 42 25 45 59 5c 66 52  s what \fB%EY\fR
6fb0: 0a 70 72 6f 64 75 63 65 73 2e 20 20 4f 66 74 65  .produces.  Ofte
6fc0: 6e 20 73 79 6e 6f 6e 79 6d 6f 75 73 20 77 69 74  n synonymous wit
6fd0: 68 20 5c 66 42 25 45 43 25 45 79 5c 66 52 2e 0a  h \fB%EC%Ey\fR..
6fe0: 2e 49 50 20 5c 66 42 25 67 5c 66 52 0a 4f 6e 20  .IP \fB%g\fR.On 
6ff0: 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73  output, produces
7000: 20 61 20 74 77 6f 2d 64 69 67 69 74 20 79 65 61   a two-digit yea
7010: 72 20 6e 75 6d 62 65 72 20 73 75 69 74 61 62 6c  r number suitabl
7020: 65 20 66 6f 72 20 75 73 65 20 77 69 74 68 0a 74  e for use with.t
7030: 68 65 20 77 65 65 6b 2d 62 61 73 65 64 20 49 53  he week-based IS
7040: 4f 38 36 30 31 20 63 61 6c 65 6e 64 61 72 3b 20  O8601 calendar; 
7050: 74 68 61 74 20 69 73 2c 20 74 68 65 20 79 65 61  that is, the yea
7060: 72 20 6e 75 6d 62 65 72 20 63 6f 72 72 65 73 70  r number corresp
7070: 6f 6e 64 73 0a 74 6f 20 74 68 65 20 77 65 65 6b  onds.to the week
7080: 20 6e 75 6d 62 65 72 20 70 72 6f 64 75 63 65 64   number produced
7090: 20 62 79 20 5c 66 42 25 56 5c 66 52 2e 20 20 4f   by \fB%V\fR.  O
70a0: 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70 74 73  n input, accepts
70b0: 20 73 75 63 68 0a 61 20 74 77 6f 2d 64 69 67 69   such.a two-digi
70c0: 74 20 79 65 61 72 20 6e 75 6d 62 65 72 2c 20 70  t year number, p
70d0: 6f 73 73 69 62 6c 79 20 77 69 74 68 20 6c 65 61  ossibly with lea
70e0: 64 69 6e 67 20 77 68 69 74 65 73 70 61 63 65 2e  ding whitespace.
70f0: 0a 2e 49 50 20 5c 66 42 25 47 5c 66 52 0a 4f 6e  ..IP \fB%G\fR.On
7100: 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65   output, produce
7110: 73 20 61 20 66 6f 75 72 2d 64 69 67 69 74 20 79  s a four-digit y
7120: 65 61 72 20 6e 75 6d 62 65 72 20 73 75 69 74 61  ear number suita
7130: 62 6c 65 20 66 6f 72 20 75 73 65 20 77 69 74 68  ble for use with
7140: 0a 74 68 65 20 77 65 65 6b 2d 62 61 73 65 64 20  .the week-based 
7150: 49 53 4f 38 36 30 31 20 63 61 6c 65 6e 64 61 72  ISO8601 calendar
7160: 3b 20 74 68 61 74 20 69 73 2c 20 74 68 65 20 79  ; that is, the y
7170: 65 61 72 20 6e 75 6d 62 65 72 20 63 6f 72 72 65  ear number corre
7180: 73 70 6f 6e 64 73 0a 74 6f 20 74 68 65 20 77 65  sponds.to the we
7190: 65 6b 20 6e 75 6d 62 65 72 20 70 72 6f 64 75 63  ek number produc
71a0: 65 64 20 62 79 20 5c 66 42 25 56 5c 66 52 2e 20  ed by \fB%V\fR. 
71b0: 20 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70   On input, accep
71c0: 74 73 20 73 75 63 68 0a 61 20 66 6f 75 72 2d 64  ts such.a four-d
71d0: 69 67 69 74 20 79 65 61 72 20 6e 75 6d 62 65 72  igit year number
71e0: 2c 20 70 6f 73 73 69 62 6c 79 20 77 69 74 68 20  , possibly with 
71f0: 6c 65 61 64 69 6e 67 20 77 68 69 74 65 73 70 61  leading whitespa
7200: 63 65 2e 0a 2e 49 50 20 5c 66 42 25 68 5c 66 52  ce...IP \fB%h\fR
7210: 0a 54 68 69 73 20 66 6f 72 6d 61 74 20 67 72 6f  .This format gro
7220: 75 70 20 69 73 20 73 79 6e 6f 6e 79 6d 6f 75 73  up is synonymous
7230: 20 77 69 74 68 20 5c 66 42 25 62 5c 66 52 2e 0a   with \fB%b\fR..
7240: 2e 49 50 20 5c 66 42 25 48 5c 66 52 0a 4f 6e 20  .IP \fB%H\fR.On 
7250: 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73  output, produces
7260: 20 61 20 74 77 6f 2d 64 69 67 69 74 20 6e 75 6d   a two-digit num
7270: 62 65 72 20 67 69 76 69 6e 67 20 74 68 65 20 68  ber giving the h
7280: 6f 75 72 20 6f 66 20 74 68 65 20 64 61 79 0a 28  our of the day.(
7290: 30 30 2d 32 33 29 20 6f 6e 20 61 20 32 34 2d 68  00-23) on a 24-h
72a0: 6f 75 72 20 63 6c 6f 63 6b 2e 20 20 4f 6e 20 69  our clock.  On i
72b0: 6e 70 75 74 2c 20 61 63 63 65 70 74 73 20 73 75  nput, accepts su
72c0: 63 68 20 61 20 6e 75 6d 62 65 72 2e 0a 2e 49 50  ch a number...IP
72d0: 20 5c 66 42 25 49 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%I\fR.On out
72e0: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20  put, produces a 
72f0: 74 77 6f 2d 64 69 67 69 74 20 6e 75 6d 62 65 72  two-digit number
7300: 20 67 69 76 69 6e 67 20 74 68 65 20 68 6f 75 72   giving the hour
7310: 20 6f 66 20 74 68 65 20 64 61 79 0a 28 31 32 2d   of the day.(12-
7320: 31 31 29 20 6f 6e 20 61 20 31 32 2d 68 6f 75 72  11) on a 12-hour
7330: 20 63 6c 6f 63 6b 2e 20 20 4f 6e 20 69 6e 70 75   clock.  On inpu
7340: 74 2c 20 61 63 63 65 70 74 73 20 73 75 63 68 20  t, accepts such 
7350: 61 20 6e 75 6d 62 65 72 2e 0a 2e 49 50 20 5c 66  a number...IP \f
7360: 42 25 6a 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74  B%j\fR.On output
7370: 2c 20 70 72 6f 64 75 63 65 73 20 61 20 74 68 72  , produces a thr
7380: 65 65 2d 64 69 67 69 74 20 6e 75 6d 62 65 72 20  ee-digit number 
7390: 67 69 76 69 6e 67 20 74 68 65 20 64 61 79 20 6f  giving the day o
73a0: 66 20 74 68 65 20 79 65 61 72 0a 28 30 30 31 2d  f the year.(001-
73b0: 33 36 36 29 2e 20 20 4f 6e 20 69 6e 70 75 74 2c  366).  On input,
73c0: 20 61 63 63 65 70 74 73 20 73 75 63 68 20 61 20   accepts such a 
73d0: 6e 75 6d 62 65 72 2e 0a 2e 49 50 20 5c 66 42 25  number...IP \fB%
73e0: 4a 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20  J\fR.On output, 
73f0: 70 72 6f 64 75 63 65 73 20 61 20 73 74 72 69 6e  produces a strin
7400: 67 20 6f 66 20 64 69 67 69 74 73 20 67 69 76 69  g of digits givi
7410: 6e 67 20 74 68 65 20 63 61 6c 65 6e 64 61 72 20  ng the calendar 
7420: 4a 75 6c 69 61 6e 20 44 61 79 20 4e 75 6d 62 65  Julian Day Numbe
7430: 72 2e 0a 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63  r..On input, acc
7440: 65 70 74 73 20 61 20 73 74 72 69 6e 67 20 6f 66  epts a string of
7450: 20 64 69 67 69 74 73 20 61 6e 64 20 69 6e 74 65   digits and inte
7460: 72 70 72 65 74 73 20 69 74 20 61 73 20 61 20 4a  rprets it as a J
7470: 75 6c 69 61 6e 20 44 61 79 20 4e 75 6d 62 65 72  ulian Day Number
7480: 2e 0a 54 68 65 20 4a 75 6c 69 61 6e 20 44 61 79  ..The Julian Day
7490: 20 4e 75 6d 62 65 72 20 69 73 20 61 20 63 6f 75   Number is a cou
74a0: 6e 74 20 6f 66 20 74 68 65 20 6e 75 6d 62 65 72  nt of the number
74b0: 20 6f 66 20 63 61 6c 65 6e 64 61 72 20 64 61 79   of calendar day
74c0: 73 0a 74 68 61 74 20 68 61 76 65 20 65 6c 61 70  s.that have elap
74d0: 73 65 64 20 73 69 6e 63 65 20 31 20 4a 61 6e 75  sed since 1 Janu
74e0: 61 72 79 2c 20 34 37 31 33 20 42 43 45 20 6f 66  ary, 4713 BCE of
74f0: 20 74 68 65 20 70 72 6f 6c 65 70 74 69 63 0a 4a   the proleptic.J
7500: 75 6c 69 61 6e 20 63 61 6c 65 6e 64 61 72 2e 20  ulian calendar. 
7510: 20 54 68 65 20 65 70 6f 63 68 20 74 69 6d 65 20   The epoch time 
7520: 6f 66 20 31 20 4a 61 6e 75 61 72 79 20 31 39 37  of 1 January 197
7530: 30 20 63 6f 72 72 65 73 70 6f 6e 64 73 0a 74 6f  0 corresponds.to
7540: 20 4a 75 6c 69 61 6e 20 44 61 79 20 4e 75 6d 62   Julian Day Numb
7550: 65 72 20 32 34 34 30 35 38 38 2e 0a 2e 49 50 20  er 2440588...IP 
7560: 5c 66 42 25 6b 5c 66 52 0a 4f 6e 20 6f 75 74 70  \fB%k\fR.On outp
7570: 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20 6f  ut, produces a o
7580: 6e 65 2d 20 6f 72 20 74 77 6f 2d 64 69 67 69 74  ne- or two-digit
7590: 20 6e 75 6d 62 65 72 20 67 69 76 69 6e 67 20 74   number giving t
75a0: 68 65 20 68 6f 75 72 20 6f 66 20 74 68 65 20 64  he hour of the d
75b0: 61 79 0a 28 30 2d 32 33 29 20 6f 6e 20 61 20 32  ay.(0-23) on a 2
75c0: 34 2d 68 6f 75 72 20 63 6c 6f 63 6b 2e 20 20 4f  4-hour clock.  O
75d0: 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70 74 73  n input, accepts
75e0: 20 73 75 63 68 20 61 20 6e 75 6d 62 65 72 2e 0a   such a number..
75f0: 2e 49 50 20 5c 66 42 25 6c 5c 66 52 0a 4f 6e 20  .IP \fB%l\fR.On 
7600: 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73  output, produces
7610: 20 61 20 6f 6e 65 2d 20 6f 72 20 74 77 6f 2d 64   a one- or two-d
7620: 69 67 69 74 20 6e 75 6d 62 65 72 20 67 69 76 69  igit number givi
7630: 6e 67 20 74 68 65 20 68 6f 75 72 20 6f 66 20 74  ng the hour of t
7640: 68 65 20 64 61 79 0a 28 31 32 2d 31 31 29 20 6f  he day.(12-11) o
7650: 6e 20 61 20 31 32 2d 68 6f 75 72 20 63 6c 6f 63  n a 12-hour cloc
7660: 6b 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20 61 63  k.  On input, ac
7670: 63 65 70 74 73 20 73 75 63 68 20 61 20 6e 75 6d  cepts such a num
7680: 62 65 72 2e 0a 2e 49 50 20 5c 66 42 25 6d 5c 66  ber...IP \fB%m\f
7690: 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f  R.On output, pro
76a0: 64 75 63 65 73 20 74 68 65 20 6e 75 6d 62 65 72  duces the number
76b0: 20 6f 66 20 74 68 65 20 6d 6f 6e 74 68 20 28 30   of the month (0
76c0: 31 2d 31 32 29 20 77 69 74 68 20 65 78 61 63 74  1-12) with exact
76d0: 6c 79 20 74 77 6f 0a 64 69 67 69 74 73 2e 20 20  ly two.digits.  
76e0: 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70 74  On input, accept
76f0: 73 20 74 77 6f 20 64 69 67 69 74 73 20 61 6e 64  s two digits and
7700: 20 69 6e 74 65 72 70 72 65 74 73 20 74 68 65 6d   interprets them
7710: 20 61 73 20 74 68 65 20 6e 75 6d 62 65 72 0a 6f   as the number.o
7720: 66 20 74 68 65 20 6d 6f 6e 74 68 2e 0a 2e 49 50  f the month...IP
7730: 20 5c 66 42 25 4d 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%M\fR.On out
7740: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 74 68  put, produces th
7750: 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20  e number of the 
7760: 6d 69 6e 75 74 65 20 6f 66 20 74 68 65 20 68 6f  minute of the ho
7770: 75 72 20 28 30 30 2d 35 39 29 0a 77 69 74 68 20  ur (00-59).with 
7780: 65 78 61 63 74 6c 79 20 74 77 6f 20 64 69 67 69  exactly two digi
7790: 74 73 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20 61  ts.  On input, a
77a0: 63 63 65 70 74 73 20 74 77 6f 20 64 69 67 69 74  ccepts two digit
77b0: 73 20 61 6e 64 20 69 6e 74 65 72 70 72 65 74 73  s and interprets
77c0: 20 74 68 65 6d 0a 61 73 20 74 68 65 20 6e 75 6d   them.as the num
77d0: 62 65 72 20 6f 66 20 74 68 65 20 6d 69 6e 75 74  ber of the minut
77e0: 65 20 6f 66 20 74 68 65 20 68 6f 75 72 2e 0a 2e  e of the hour...
77f0: 49 50 20 5c 66 42 25 4e 5c 66 52 0a 4f 6e 20 6f  IP \fB%N\fR.On o
7800: 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20  utput, produces 
7810: 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68  the number of th
7820: 65 20 6d 6f 6e 74 68 20 28 31 2d 31 32 29 20 77  e month (1-12) w
7830: 69 74 68 20 6f 6e 65 20 6f 72 20 74 77 6f 20 64  ith one or two d
7840: 69 67 69 74 73 2c 0a 61 6e 64 20 61 20 6c 65 61  igits,.and a lea
7850: 64 69 6e 67 20 62 6c 61 6e 6b 20 66 6f 72 20 6f  ding blank for o
7860: 6e 65 2d 64 69 67 69 74 20 64 61 74 65 73 2e 0a  ne-digit dates..
7870: 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70 74  On input, accept
7880: 73 20 6f 6e 65 20 6f 72 20 74 77 6f 20 64 69 67  s one or two dig
7890: 69 74 73 2c 20 70 6f 73 73 69 62 6c 79 20 77 69  its, possibly wi
78a0: 74 68 20 6c 65 61 64 69 6e 67 20 77 68 69 74 65  th leading white
78b0: 73 70 61 63 65 2c 0a 61 6e 64 20 69 6e 74 65 72  space,.and inter
78c0: 70 72 65 74 73 20 74 68 65 6d 20 61 73 20 74 68  prets them as th
78d0: 65 20 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20  e number of the 
78e0: 6d 6f 6e 74 68 2e 0a 2e 49 50 20 22 5c 66 42 25  month...IP "\fB%
78f0: 4f 64 5c 66 52 2c 20 5c 66 42 25 4f 65 5c 66 52  Od\fR, \fB%Oe\fR
7900: 2c 20 5c 66 42 25 4f 48 5c 66 52 2c 20 5c 66 42  , \fB%OH\fR, \fB
7910: 25 4f 49 5c 66 52 2c 20 5c 66 42 25 4f 6b 5c 66  %OI\fR, \fB%Ok\f
7920: 52 2c 20 5c 66 42 25 4f 6c 5c 66 52 2c 20 5c 66  R, \fB%Ol\fR, \f
7930: 42 25 4f 6d 5c 66 52 2c 20 5c 66 42 25 4f 4d 5c  B%Om\fR, \fB%OM\
7940: 66 52 2c 20 5c 66 42 25 4f 53 5c 66 52 2c 20 5c  fR, \fB%OS\fR, \
7950: 66 42 25 4f 75 5c 66 52 2c 20 5c 66 42 25 4f 77  fB%Ou\fR, \fB%Ow
7960: 5c 66 52 2c 20 5c 66 42 25 4f 79 5c 66 52 22 0a  \fR, \fB%Oy\fR".
7970: 41 6c 6c 20 6f 66 20 74 68 65 73 65 20 66 6f 72  All of these for
7980: 6d 61 74 20 67 72 6f 75 70 73 20 61 72 65 20 73  mat groups are s
7990: 79 6e 6f 6e 79 6d 6f 75 73 20 77 69 74 68 20 74  ynonymous with t
79a0: 68 65 69 72 20 63 6f 75 6e 74 65 72 70 61 72 74  heir counterpart
79b0: 73 0a 77 69 74 68 6f 75 74 20 74 68 65 0a 2e 51  s.without the..Q
79c0: 57 20 5c 66 42 4f 5c 66 52 20 2c 0a 65 78 63 65  W \fBO\fR ,.exce
79d0: 70 74 20 74 68 61 74 20 74 68 65 20 73 74 72 69  pt that the stri
79e0: 6e 67 20 69 73 20 70 72 6f 64 75 63 65 64 20 61  ng is produced a
79f0: 6e 64 20 70 61 72 73 65 64 20 69 6e 20 74 68 65  nd parsed in the
7a00: 0a 6c 6f 63 61 6c 65 2d 64 65 70 65 6e 64 65 6e  .locale-dependen
7a10: 74 20 61 6c 74 65 72 6e 61 74 69 76 65 20 6e 75  t alternative nu
7a20: 6d 65 72 61 6c 73 2e 0a 2e 49 50 20 5c 66 42 25  merals...IP \fB%
7a30: 70 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20  p\fR.On output, 
7a40: 70 72 6f 64 75 63 65 73 20 61 6e 20 69 6e 64 69  produces an indi
7a50: 63 61 74 6f 72 20 66 6f 72 20 74 68 65 20 70 61  cator for the pa
7a60: 72 74 20 6f 66 20 74 68 65 20 64 61 79 2c 20 5c  rt of the day, \
7a70: 66 42 41 4d 5c 66 52 0a 6f 72 20 5c 66 42 50 4d  fBAM\fR.or \fBPM
7a80: 5c 66 52 2c 20 61 70 70 72 6f 70 72 69 61 74 65  \fR, appropriate
7a90: 20 74 6f 20 74 68 65 20 67 69 76 65 6e 20 6c 6f   to the given lo
7aa0: 63 61 6c 65 2e 20 20 49 66 20 74 68 65 20 73 63  cale.  If the sc
7ab0: 72 69 70 74 20 6f 66 20 74 68 65 0a 67 69 76 65  ript of the.give
7ac0: 6e 20 6c 6f 63 61 6c 65 20 73 75 70 70 6f 72 74  n locale support
7ad0: 73 20 6d 75 6c 74 69 70 6c 65 20 6c 65 74 74 65  s multiple lette
7ae0: 72 66 6f 72 6d 73 2c 20 6c 6f 77 65 72 63 61 73  rforms, lowercas
7af0: 65 20 69 73 20 70 72 65 66 65 72 72 65 64 2e 0a  e is preferred..
7b00: 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74 63 68 65  On input, matche
7b10: 73 20 74 68 65 20 72 65 70 72 65 73 65 6e 74 61  s the representa
7b20: 74 69 6f 6e 20 5c 66 42 41 4d 5c 66 52 20 6f 72  tion \fBAM\fR or
7b30: 20 5c 66 42 50 4d 5c 66 52 20 69 6e 0a 74 68 65   \fBPM\fR in.the
7b40: 20 67 69 76 65 6e 20 6c 6f 63 61 6c 65 2c 20 69   given locale, i
7b50: 6e 20 65 69 74 68 65 72 20 63 61 73 65 2e 0a 2e  n either case...
7b60: 49 50 20 5c 66 42 25 50 5c 66 52 0a 4f 6e 20 6f  IP \fB%P\fR.On o
7b70: 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20  utput, produces 
7b80: 61 6e 20 69 6e 64 69 63 61 74 6f 72 20 66 6f 72  an indicator for
7b90: 20 74 68 65 20 70 61 72 74 20 6f 66 20 74 68 65   the part of the
7ba0: 20 64 61 79 2c 20 5c 66 42 61 6d 5c 66 52 0a 6f   day, \fBam\fR.o
7bb0: 72 20 5c 66 42 70 6d 5c 66 52 2c 20 61 70 70 72  r \fBpm\fR, appr
7bc0: 6f 70 72 69 61 74 65 20 74 6f 20 74 68 65 20 67  opriate to the g
7bd0: 69 76 65 6e 20 6c 6f 63 61 6c 65 2e 20 20 49 66  iven locale.  If
7be0: 20 74 68 65 20 73 63 72 69 70 74 20 6f 66 20 74   the script of t
7bf0: 68 65 0a 67 69 76 65 6e 20 6c 6f 63 61 6c 65 20  he.given locale 
7c00: 73 75 70 70 6f 72 74 73 20 6d 75 6c 74 69 70 6c  supports multipl
7c10: 65 20 6c 65 74 74 65 72 66 6f 72 6d 73 2c 20 75  e letterforms, u
7c20: 70 70 65 72 63 61 73 65 20 69 73 20 70 72 65 66  ppercase is pref
7c30: 65 72 72 65 64 2e 0a 4f 6e 20 69 6e 70 75 74 2c  erred..On input,
7c40: 20 6d 61 74 63 68 65 73 20 74 68 65 20 72 65 70   matches the rep
7c50: 72 65 73 65 6e 74 61 74 69 6f 6e 20 5c 66 42 41  resentation \fBA
7c60: 4d 5c 66 52 20 6f 72 20 5c 66 42 50 4d 5c 66 52  M\fR or \fBPM\fR
7c70: 20 69 6e 0a 74 68 65 20 67 69 76 65 6e 20 6c 6f   in.the given lo
7c80: 63 61 6c 65 2c 20 69 6e 20 65 69 74 68 65 72 20  cale, in either 
7c90: 63 61 73 65 2e 0a 2e 49 50 20 5c 66 42 25 51 5c  case...IP \fB%Q\
7ca0: 66 52 0a 54 68 69 73 20 66 6f 72 6d 61 74 20 67  fR.This format g
7cb0: 72 6f 75 70 20 69 73 20 72 65 73 65 72 76 65 64  roup is reserved
7cc0: 20 66 6f 72 20 69 6e 74 65 72 6e 61 6c 20 75 73   for internal us
7cd0: 65 20 77 69 74 68 69 6e 20 74 68 65 20 54 63 6c  e within the Tcl
7ce0: 20 6c 69 62 72 61 72 79 2e 0a 2e 5c 22 20 49 74   library...\" It
7cf0: 27 73 20 74 68 65 20 53 54 41 52 44 41 54 45 21  's the STARDATE!
7d00: 20 57 65 27 72 65 20 73 6f 20 45 6e 74 65 72 70   We're so Enterp
7d10: 72 69 73 65 2d 72 65 61 64 79 2e 2e 2e 0a 2e 49  rise-ready.....I
7d20: 50 20 5c 66 42 25 72 5c 66 52 0a 4f 6e 20 6f 75  P \fB%r\fR.On ou
7d30: 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61  tput, produces a
7d40: 20 6c 6f 63 61 6c 65 2d 64 65 70 65 6e 64 65 6e   locale-dependen
7d50: 74 20 74 69 6d 65 20 6f 66 20 64 61 79 20 72 65  t time of day re
7d60: 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f 6e 20  presentation on 
7d70: 61 0a 31 32 2d 68 6f 75 72 20 63 6c 6f 63 6b 2e  a.12-hour clock.
7d80: 20 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70   On input, accep
7d90: 74 73 20 77 68 61 74 65 76 65 72 20 5c 66 42 25  ts whatever \fB%
7da0: 72 5c 66 52 20 70 72 6f 64 75 63 65 73 2e 0a 2e  r\fR produces...
7db0: 49 50 20 5c 66 42 25 52 5c 66 52 0a 4f 6e 20 6f  IP \fB%R\fR.On o
7dc0: 75 74 70 75 74 2c 20 74 68 65 20 74 69 6d 65 20  utput, the time 
7dd0: 69 6e 20 32 34 2d 68 6f 75 72 20 6e 6f 74 61 74  in 24-hour notat
7de0: 69 6f 6e 20 28 25 48 3a 25 4d 29 2e 20 46 6f 72  ion (%H:%M). For
7df0: 20 61 20 76 65 72 73 69 6f 6e 0a 69 6e 63 6c 75   a version.inclu
7e00: 64 69 6e 67 20 74 68 65 20 73 65 63 6f 6e 64 73  ding the seconds
7e10: 2c 20 73 65 65 20 5c 66 42 25 54 5c 66 52 20 62  , see \fB%T\fR b
7e20: 65 6c 6f 77 2e 20 4f 6e 20 69 6e 70 75 74 2c 20  elow. On input, 
7e30: 61 63 63 65 70 74 73 20 77 68 61 74 65 76 65 72  accepts whatever
7e40: 0a 5c 66 42 25 52 5c 66 52 20 70 72 6f 64 75 63  .\fB%R\fR produc
7e50: 65 73 2e 0a 2e 49 50 20 5c 66 42 25 73 5c 66 52  es...IP \fB%s\fR
7e60: 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 73 69 6d 70  .On output, simp
7e70: 6c 79 20 66 6f 72 6d 61 74 73 20 74 68 65 20 5c  ly formats the \
7e80: 66 49 74 69 6d 65 56 61 6c 5c 66 52 20 61 72 67  fItimeVal\fR arg
7e90: 75 6d 65 6e 74 20 61 73 20 61 20 64 65 63 69 6d  ument as a decim
7ea0: 61 6c 0a 69 6e 74 65 67 65 72 20 61 6e 64 20 69  al.integer and i
7eb0: 6e 73 65 72 74 73 20 69 74 20 69 6e 74 6f 20 74  nserts it into t
7ec0: 68 65 20 6f 75 74 70 75 74 20 73 74 72 69 6e 67  he output string
7ed0: 2e 20 20 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63  .  On input, acc
7ee0: 65 70 74 73 0a 61 20 64 65 63 69 6d 61 6c 20 69  epts.a decimal i
7ef0: 6e 74 65 67 65 72 20 61 6e 64 20 75 73 65 73 20  nteger and uses 
7f00: 69 73 20 61 73 20 74 68 65 20 74 69 6d 65 20 76  is as the time v
7f10: 61 6c 75 65 20 77 69 74 68 6f 75 74 20 61 6e 79  alue without any
7f20: 20 66 75 72 74 68 65 72 0a 70 72 6f 63 65 73 73   further.process
7f30: 69 6e 67 2e 20 53 69 6e 63 65 20 5c 66 42 25 73  ing. Since \fB%s
7f40: 5c 66 52 20 75 6e 69 71 75 65 6c 79 20 64 65 74  \fR uniquely det
7f50: 65 72 6d 69 6e 65 73 20 61 20 70 6f 69 6e 74 20  ermines a point 
7f60: 69 6e 20 74 69 6d 65 2c 20 69 74 0a 6f 76 65 72  in time, it.over
7f70: 72 69 64 65 73 20 61 6c 6c 20 6f 74 68 65 72 20  rides all other 
7f80: 69 6e 70 75 74 20 66 6f 72 6d 61 74 73 2e 0a 2e  input formats...
7f90: 49 50 20 5c 66 42 25 53 5c 66 52 0a 4f 6e 20 6f  IP \fB%S\fR.On o
7fa0: 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20  utput, produces 
7fb0: 61 20 74 77 6f 2d 64 69 67 69 74 20 6e 75 6d 62  a two-digit numb
7fc0: 65 72 20 6f 66 20 74 68 65 20 73 65 63 6f 6e 64  er of the second
7fd0: 20 6f 66 20 74 68 65 20 6d 69 6e 75 74 65 0a 28   of the minute.(
7fe0: 30 30 2d 35 39 29 2e 20 4f 6e 20 69 6e 70 75 74  00-59). On input
7ff0: 2c 20 61 63 63 65 70 74 73 20 74 77 6f 20 64 69  , accepts two di
8000: 67 69 74 73 20 61 6e 64 20 75 73 65 73 20 74 68  gits and uses th
8010: 65 6d 20 61 73 20 74 68 65 20 73 65 63 6f 6e 64  em as the second
8020: 20 6f 66 20 74 68 65 0a 6d 69 6e 75 74 65 2e 0a   of the.minute..
8030: 2e 49 50 20 5c 66 42 25 74 5c 66 52 0a 4f 6e 20  .IP \fB%t\fR.On 
8040: 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65 73  output, produces
8050: 20 61 20 54 41 42 20 63 68 61 72 61 63 74 65 72   a TAB character
8060: 2e 20 4f 6e 20 69 6e 70 75 74 2c 20 6d 61 74 63  . On input, matc
8070: 68 65 73 20 61 20 54 41 42 20 63 68 61 72 61 63  hes a TAB charac
8080: 74 65 72 2e 0a 2e 49 50 20 5c 66 42 25 54 5c 66  ter...IP \fB%T\f
8090: 52 0a 53 79 6e 6f 6e 79 6d 6f 75 73 20 77 69 74  R.Synonymous wit
80a0: 68 20 5c 66 42 25 48 3a 25 4d 3a 25 53 5c 66 52  h \fB%H:%M:%S\fR
80b0: 2e 0a 2e 49 50 20 5c 66 42 25 75 5c 66 52 0a 4f  ...IP \fB%u\fR.O
80c0: 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63  n output, produc
80d0: 65 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66  es the number of
80e0: 20 74 68 65 20 64 61 79 20 6f 66 20 74 68 65 20   the day of the 
80f0: 77 65 65 6b 0a 28 5c 66 42 31 5c 66 52 5c 28 2d  week.(\fB1\fR\(-
8100: 3e 4d 6f 6e 64 61 79 2c 20 5c 66 42 37 5c 66 52  >Monday, \fB7\fR
8110: 5c 28 2d 3e 53 75 6e 64 61 79 29 2e 20 4f 6e 20  \(->Sunday). On 
8120: 69 6e 70 75 74 2c 20 61 63 63 65 70 74 73 20 61  input, accepts a
8130: 20 73 69 6e 67 6c 65 20 64 69 67 69 74 20 61 6e   single digit an
8140: 64 0a 69 6e 74 65 72 70 72 65 74 73 20 69 74 20  d.interprets it 
8150: 61 73 20 74 68 65 20 64 61 79 20 6f 66 20 74 68  as the day of th
8160: 65 20 77 65 65 6b 2e 20 53 75 6e 64 61 79 20 6d  e week. Sunday m
8170: 61 79 20 62 65 20 65 69 74 68 65 72 20 5c 66 42  ay be either \fB
8180: 30 5c 66 52 20 6f 72 0a 5c 66 42 37 5c 66 52 2e  0\fR or.\fB7\fR.
8190: 0a 2e 49 50 20 5c 66 42 25 55 5c 66 52 0a 4f 6e  ..IP \fB%U\fR.On
81a0: 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65   output, produce
81b0: 73 20 74 68 65 20 6f 72 64 69 6e 61 6c 20 6e 75  s the ordinal nu
81c0: 6d 62 65 72 20 6f 66 20 74 68 65 20 77 65 65 6b  mber of the week
81d0: 20 6f 66 20 74 68 65 20 79 65 61 72 0a 28 30 30   of the year.(00
81e0: 2d 35 33 29 2e 20 54 68 65 20 66 69 72 73 74 20  -53). The first 
81f0: 53 75 6e 64 61 79 20 6f 66 20 74 68 65 20 79 65  Sunday of the ye
8200: 61 72 20 69 73 20 74 68 65 20 66 69 72 73 74 20  ar is the first 
8210: 64 61 79 20 6f 66 20 77 65 65 6b 20 30 31 2e 20  day of week 01. 
8220: 4f 6e 0a 69 6e 70 75 74 20 61 63 63 65 70 74 73  On.input accepts
8230: 20 74 77 6f 20 64 69 67 69 74 73 20 77 68 69 63   two digits whic
8240: 68 20 61 72 65 20 6f 74 68 65 72 77 69 73 65 20  h are otherwise 
8250: 69 67 6e 6f 72 65 64 2e 20 54 68 69 73 20 66 6f  ignored. This fo
8260: 72 6d 61 74 0a 67 72 6f 75 70 20 69 73 20 6e 65  rmat.group is ne
8270: 76 65 72 20 75 73 65 64 20 69 6e 20 64 65 74 65  ver used in dete
8280: 72 6d 69 6e 69 6e 67 20 61 6e 20 69 6e 70 75 74  rmining an input
8290: 20 64 61 74 65 2e 20 20 54 68 69 73 20 69 6e 74   date.  This int
82a0: 65 72 70 72 65 74 61 74 69 6f 6e 0a 6f 66 20 74  erpretation.of t
82b0: 68 65 20 77 65 65 6b 20 6f 66 20 74 68 65 20 79  he week of the y
82c0: 65 61 72 20 77 61 73 20 6f 6e 63 65 20 63 6f 6d  ear was once com
82d0: 6d 6f 6e 20 69 6e 20 55 53 20 62 61 6e 6b 69 6e  mon in US bankin
82e0: 67 20 62 75 74 20 69 73 20 6e 6f 77 0a 6c 61 72  g but is now.lar
82f0: 67 65 6c 79 20 6f 62 73 6f 6c 65 74 65 2e 20 20  gely obsolete.  
8300: 53 65 65 20 5c 66 42 25 56 5c 66 52 20 66 6f 72  See \fB%V\fR for
8310: 20 74 68 65 20 49 53 4f 38 36 30 31 20 77 65 65   the ISO8601 wee
8320: 6b 20 6e 75 6d 62 65 72 2e 0a 2e 49 50 20 5c 66  k number...IP \f
8330: 42 25 56 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74  B%V\fR.On output
8340: 2c 20 70 72 6f 64 75 63 65 73 20 74 68 65 20 6e  , produces the n
8350: 75 6d 62 65 72 20 6f 66 20 74 68 65 20 49 53 4f  umber of the ISO
8360: 38 36 30 31 20 77 65 65 6b 20 61 73 20 61 20 74  8601 week as a t
8370: 77 6f 20 64 69 67 69 74 0a 6e 75 6d 62 65 72 20  wo digit.number 
8380: 28 30 31 2d 35 33 29 2e 20 57 65 65 6b 20 30 31  (01-53). Week 01
8390: 20 69 73 20 74 68 65 20 77 65 65 6b 20 63 6f 6e   is the week con
83a0: 74 61 69 6e 69 6e 67 20 4a 61 6e 75 61 72 79 20  taining January 
83b0: 34 3b 20 6f 72 20 74 68 65 20 66 69 72 73 74 0a  4; or the first.
83c0: 77 65 65 6b 20 6f 66 20 74 68 65 20 79 65 61 72  week of the year
83d0: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 74 20 6c   containing at l
83e0: 65 61 73 74 20 34 20 64 61 79 73 3b 20 6f 72 20  east 4 days; or 
83f0: 74 68 65 20 77 65 65 6b 20 63 6f 6e 74 61 69 6e  the week contain
8400: 69 6e 67 0a 74 68 65 20 66 69 72 73 74 20 54 68  ing.the first Th
8410: 75 72 73 64 61 79 20 6f 66 20 74 68 65 20 79 65  ursday of the ye
8420: 61 72 20 28 74 68 65 20 74 68 72 65 65 20 73 74  ar (the three st
8430: 61 74 65 6d 65 6e 74 73 20 61 72 65 0a 65 71 75  atements are.equ
8440: 69 76 61 6c 65 6e 74 29 2e 20 45 61 63 68 20 77  ivalent). Each w
8450: 65 65 6b 20 62 65 67 69 6e 73 20 6f 6e 20 61 20  eek begins on a 
8460: 4d 6f 6e 64 61 79 2e 20 4f 6e 20 69 6e 70 75 74  Monday. On input
8470: 2c 20 61 63 63 65 70 74 73 20 74 68 65 0a 49 53  , accepts the.IS
8480: 4f 38 36 30 31 20 77 65 65 6b 20 6e 75 6d 62 65  O8601 week numbe
8490: 72 2e 0a 2e 49 50 20 5c 66 42 25 77 5c 66 52 0a  r...IP \fB%w\fR.
84a0: 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75  On output, produ
84b0: 63 65 73 20 74 68 65 20 6f 72 64 69 6e 61 6c 20  ces the ordinal 
84c0: 6e 75 6d 62 65 72 20 6f 66 20 74 68 65 20 64 61  number of the da
84d0: 79 20 6f 66 20 74 68 65 20 77 65 65 6b 0a 28 53  y of the week.(S
84e0: 75 6e 64 61 79 3d 3d 30 3b 20 53 61 74 75 72 64  unday==0; Saturd
84f0: 61 79 3d 3d 36 29 2e 20 20 4f 6e 20 69 6e 70 75  ay==6).  On inpu
8500: 74 2c 20 61 63 63 65 70 74 73 20 61 20 73 69 6e  t, accepts a sin
8510: 67 6c 65 20 64 69 67 69 74 20 61 6e 64 0a 69 6e  gle digit and.in
8520: 74 65 72 70 72 65 74 73 20 69 74 20 61 73 20 74  terprets it as t
8530: 68 65 20 64 61 79 20 6f 66 20 74 68 65 20 77 65  he day of the we
8540: 65 6b 3b 20 53 75 6e 64 61 79 20 6d 61 79 20 62  ek; Sunday may b
8550: 65 20 72 65 70 72 65 73 65 6e 74 65 64 20 61 73  e represented as
8560: 0a 65 69 74 68 65 72 20 30 20 6f 72 20 37 2e 20  .either 0 or 7. 
8570: 20 4e 6f 74 65 20 74 68 61 74 20 5c 66 42 25 77   Note that \fB%w
8580: 5c 66 52 20 69 73 20 6e 6f 74 20 74 68 65 20 49  \fR is not the I
8590: 53 4f 38 36 30 31 20 77 65 65 6b 64 61 79 20 6e  SO8601 weekday n
85a0: 75 6d 62 65 72 2c 0a 77 68 69 63 68 20 69 73 20  umber,.which is 
85b0: 70 72 6f 64 75 63 65 64 20 61 6e 64 20 61 63 63  produced and acc
85c0: 65 70 74 65 64 20 62 79 20 5c 66 42 25 75 5c 66  epted by \fB%u\f
85d0: 52 2e 0a 2e 49 50 20 5c 66 42 25 57 5c 66 52 0a  R...IP \fB%W\fR.
85e0: 4f 6e 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75  On output, produ
85f0: 63 65 73 20 61 20 77 65 65 6b 20 6e 75 6d 62 65  ces a week numbe
8600: 72 20 28 30 30 2d 35 33 29 20 77 69 74 68 69 6e  r (00-53) within
8610: 20 74 68 65 20 79 65 61 72 3b 20 77 65 65 6b 20   the year; week 
8620: 30 31 0a 62 65 67 69 6e 73 20 6f 6e 20 74 68 65  01.begins on the
8630: 20 66 69 72 73 74 20 4d 6f 6e 64 61 79 20 6f 66   first Monday of
8640: 20 74 68 65 20 79 65 61 72 2e 20 4f 6e 20 69 6e   the year. On in
8650: 70 75 74 2c 20 61 63 63 65 70 74 73 20 74 77 6f  put, accepts two
8660: 20 64 69 67 69 74 73 2c 0a 77 68 69 63 68 20 61   digits,.which a
8670: 72 65 20 6f 74 68 65 72 77 69 73 65 20 69 67 6e  re otherwise ign
8680: 6f 72 65 64 2e 20 54 68 69 73 20 66 6f 72 6d 61  ored. This forma
8690: 74 20 67 72 6f 75 70 20 69 73 20 6e 65 76 65 72  t group is never
86a0: 20 75 73 65 64 20 69 6e 0a 64 65 74 65 72 6d 69   used in.determi
86b0: 6e 69 6e 67 20 61 6e 20 69 6e 70 75 74 20 64 61  ning an input da
86c0: 74 65 2e 20 20 49 74 20 69 73 20 6e 6f 74 20 74  te.  It is not t
86d0: 68 65 20 49 53 4f 38 36 30 31 20 77 65 65 6b 20  he ISO8601 week 
86e0: 6e 75 6d 62 65 72 3b 20 74 68 61 74 0a 77 65 65  number; that.wee
86f0: 6b 20 69 73 20 70 72 6f 64 75 63 65 64 20 61 6e  k is produced an
8700: 64 20 61 63 63 65 70 74 65 64 20 62 79 20 5c 66  d accepted by \f
8710: 42 25 56 5c 66 52 2e 0a 2e 49 50 20 5c 66 42 25  B%V\fR...IP \fB%
8720: 78 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20  x\fR.On output, 
8730: 70 72 6f 64 75 63 65 73 20 74 68 65 20 64 61 74  produces the dat
8740: 65 20 69 6e 20 61 20 6c 6f 63 61 6c 65 2d 64 65  e in a locale-de
8750: 70 65 6e 64 65 6e 74 20 72 65 70 72 65 73 65 6e  pendent represen
8760: 74 61 74 69 6f 6e 2e 20 4f 6e 0a 69 6e 70 75 74  tation. On.input
8770: 2c 20 61 63 63 65 70 74 73 20 77 68 61 74 65 76  , accepts whatev
8780: 65 72 20 5c 66 42 25 78 5c 66 52 20 70 72 6f 64  er \fB%x\fR prod
8790: 75 63 65 73 20 61 6e 64 20 69 73 20 75 73 65 64  uces and is used
87a0: 20 74 6f 20 64 65 74 65 72 6d 69 6e 65 0a 63 61   to determine.ca
87b0: 6c 65 6e 64 61 72 20 64 61 74 65 2e 0a 2e 49 50  lendar date...IP
87c0: 20 5c 66 42 25 58 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%X\fR.On out
87d0: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 74 68  put, produces th
87e0: 65 20 74 69 6d 65 20 6f 66 20 64 61 79 20 69 6e  e time of day in
87f0: 20 61 20 6c 6f 63 61 6c 65 2d 64 65 70 65 6e 64   a locale-depend
8800: 65 6e 74 0a 72 65 70 72 65 73 65 6e 74 61 74 69  ent.representati
8810: 6f 6e 2e 20 4f 6e 20 69 6e 70 75 74 2c 20 61 63  on. On input, ac
8820: 63 65 70 74 73 20 77 68 61 74 65 76 65 72 20 5c  cepts whatever \
8830: 66 42 25 58 5c 66 52 20 70 72 6f 64 75 63 65 73  fB%X\fR produces
8840: 20 61 6e 64 20 69 73 20 75 73 65 64 0a 74 6f 20   and is used.to 
8850: 64 65 74 65 72 6d 69 6e 65 20 74 69 6d 65 20 6f  determine time o
8860: 66 20 64 61 79 2e 0a 2e 49 50 20 5c 66 42 25 79  f day...IP \fB%y
8870: 5c 66 52 0a 4f 6e 20 6f 75 74 70 75 74 2c 20 70  \fR.On output, p
8880: 72 6f 64 75 63 65 73 20 74 68 65 20 74 77 6f 2d  roduces the two-
8890: 64 69 67 69 74 20 79 65 61 72 20 6f 66 20 74 68  digit year of th
88a0: 65 20 63 65 6e 74 75 72 79 2e 20 4f 6e 20 69 6e  e century. On in
88b0: 70 75 74 2c 0a 61 63 63 65 70 74 73 20 74 77 6f  put,.accepts two
88c0: 20 64 69 67 69 74 73 2c 20 61 6e 64 20 69 73 20   digits, and is 
88d0: 75 73 65 64 20 74 6f 20 64 65 74 65 72 6d 69 6e  used to determin
88e0: 65 20 63 61 6c 65 6e 64 61 72 20 64 61 74 65 2e  e calendar date.
88f0: 20 54 68 65 0a 64 61 74 65 20 69 73 20 70 72 65   The.date is pre
8900: 73 75 6d 65 64 20 74 6f 20 6c 69 65 20 62 65 74  sumed to lie bet
8910: 77 65 65 6e 20 31 39 33 38 20 61 6e 64 20 32 30  ween 1938 and 20
8920: 33 37 20 69 6e 63 6c 75 73 69 76 65 2e 20 4e 6f  37 inclusive. No
8930: 74 65 0a 74 68 61 74 20 5c 66 42 25 79 5c 66 52  te.that \fB%y\fR
8940: 20 64 6f 65 73 20 6e 6f 74 20 79 69 65 6c 64 20   does not yield 
8950: 61 20 79 65 61 72 20 61 70 70 72 6f 70 72 69 61  a year appropria
8960: 74 65 20 66 6f 72 20 75 73 65 20 77 69 74 68 20  te for use with 
8970: 74 68 65 20 49 53 4f 38 36 30 31 0a 77 65 65 6b  the ISO8601.week
8980: 20 6e 75 6d 62 65 72 20 5c 66 42 25 56 5c 66 52   number \fB%V\fR
8990: 3b 20 70 72 6f 67 72 61 6d 73 20 73 68 6f 75 6c  ; programs shoul
89a0: 64 20 75 73 65 20 5c 66 42 25 67 5c 66 52 20 66  d use \fB%g\fR f
89b0: 6f 72 20 74 68 61 74 20 70 75 72 70 6f 73 65 2e  or that purpose.
89c0: 0a 2e 49 50 20 5c 66 42 25 59 5c 66 52 0a 4f 6e  ..IP \fB%Y\fR.On
89d0: 20 6f 75 74 70 75 74 2c 20 70 72 6f 64 75 63 65   output, produce
89e0: 73 20 74 68 65 20 66 6f 75 72 2d 64 69 67 69 74  s the four-digit
89f0: 20 63 61 6c 65 6e 64 61 72 20 79 65 61 72 2e 20   calendar year. 
8a00: 4f 6e 20 69 6e 70 75 74 2c 0a 61 63 63 65 70 74  On input,.accept
8a10: 73 20 66 6f 75 72 20 64 69 67 69 74 73 20 61 6e  s four digits an
8a20: 64 20 6d 61 79 20 62 65 20 75 73 65 64 20 74 6f  d may be used to
8a30: 20 64 65 74 65 72 6d 69 6e 65 20 63 61 6c 65 6e   determine calen
8a40: 64 61 72 20 64 61 74 65 2e 20 4e 6f 74 65 0a 74  dar date. Note.t
8a50: 68 61 74 20 5c 66 42 25 59 5c 66 52 20 64 6f 65  hat \fB%Y\fR doe
8a60: 73 20 6e 6f 74 20 79 69 65 6c 64 20 61 20 79 65  s not yield a ye
8a70: 61 72 20 61 70 70 72 6f 70 72 69 61 74 65 20 66  ar appropriate f
8a80: 6f 72 20 75 73 65 20 77 69 74 68 20 74 68 65 20  or use with the 
8a90: 49 53 4f 38 36 30 31 0a 77 65 65 6b 20 6e 75 6d  ISO8601.week num
8aa0: 62 65 72 20 5c 66 42 25 56 5c 66 52 3b 20 70 72  ber \fB%V\fR; pr
8ab0: 6f 67 72 61 6d 73 20 73 68 6f 75 6c 64 20 75 73  ograms should us
8ac0: 65 20 5c 66 42 25 47 5c 66 52 20 66 6f 72 20 74  e \fB%G\fR for t
8ad0: 68 61 74 20 70 75 72 70 6f 73 65 2e 0a 2e 49 50  hat purpose...IP
8ae0: 20 5c 66 42 25 7a 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%z\fR.On out
8af0: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 74 68  put, produces th
8b00: 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 7a  e current time z
8b10: 6f 6e 65 2c 20 65 78 70 72 65 73 73 65 64 20 69  one, expressed i
8b20: 6e 20 68 6f 75 72 73 20 61 6e 64 0a 6d 69 6e 75  n hours and.minu
8b30: 74 65 73 20 65 61 73 74 20 28 2b 68 68 6d 6d 29  tes east (+hhmm)
8b40: 20 6f 72 20 77 65 73 74 20 28 5c 2d 68 68 6d 6d   or west (\-hhmm
8b50: 29 20 6f 66 20 47 72 65 65 6e 77 69 63 68 2e 20  ) of Greenwich. 
8b60: 4f 6e 20 69 6e 70 75 74 2c 20 61 63 63 65 70 74  On input, accept
8b70: 73 20 61 0a 74 69 6d 65 20 7a 6f 6e 65 20 73 70  s a.time zone sp
8b80: 65 63 69 66 69 65 72 20 28 73 65 65 20 5c 66 42  ecifier (see \fB
8b90: 54 49 4d 45 20 5a 4f 4e 45 53 5c 66 52 20 62 65  TIME ZONES\fR be
8ba0: 6c 6f 77 29 20 74 68 61 74 20 77 69 6c 6c 20 62  low) that will b
8bb0: 65 20 75 73 65 64 20 74 6f 0a 64 65 74 65 72 6d  e used to.determ
8bc0: 69 6e 65 20 74 68 65 20 74 69 6d 65 20 7a 6f 6e  ine the time zon
8bd0: 65 20 28 74 68 69 73 20 74 6f 6b 65 6e 20 69 73  e (this token is
8be0: 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 61 70 70 6c   optionally appl
8bf0: 69 63 61 62 6c 65 20 6f 6e 20 69 6e 70 75 74 2c  icable on input,
8c00: 0a 73 6f 20 74 68 65 20 76 61 6c 75 65 20 69 73  .so the value is
8c10: 20 6e 6f 74 20 6d 61 6e 64 61 74 6f 72 79 20 61   not mandatory a
8c20: 6e 64 20 63 61 6e 20 62 65 20 6d 69 73 73 69 6e  nd can be missin
8c30: 67 20 69 6e 20 69 6e 70 75 74 29 2e 0a 2e 49 50  g in input)...IP
8c40: 20 5c 66 42 25 5a 5c 66 52 0a 4f 6e 20 6f 75 74   \fB%Z\fR.On out
8c50: 70 75 74 2c 20 70 72 6f 64 75 63 65 73 20 74 68  put, produces th
8c60: 65 20 63 75 72 72 65 6e 74 20 74 69 6d 65 20 7a  e current time z
8c70: 6f 6e 65 27 73 20 6e 61 6d 65 2c 20 70 6f 73 73  one's name, poss
8c80: 69 62 6c 79 0a 74 72 61 6e 73 6c 61 74 65 64 20  ibly.translated 
8c90: 74 6f 20 74 68 65 20 67 69 76 65 6e 20 6c 6f 63  to the given loc
8ca0: 61 6c 65 2e 20 4f 6e 20 69 6e 70 75 74 2c 20 61  ale. On input, a
8cb0: 63 63 65 70 74 73 20 61 20 74 69 6d 65 20 7a 6f  ccepts a time zo
8cc0: 6e 65 0a 73 70 65 63 69 66 69 65 72 20 28 73 65  ne.specifier (se
8cd0: 65 20 5c 66 42 54 49 4d 45 20 5a 4f 4e 45 53 5c  e \fBTIME ZONES\
8ce0: 66 52 20 62 65 6c 6f 77 29 20 74 68 61 74 20 77  fR below) that w
8cf0: 69 6c 6c 20 62 65 20 75 73 65 64 20 74 6f 20 64  ill be used to d
8d00: 65 74 65 72 6d 69 6e 65 20 74 68 65 0a 74 69 6d  etermine the.tim
8d10: 65 20 7a 6f 6e 65 20 28 74 6f 6b 65 6e 20 69 73  e zone (token is
8d20: 20 61 6c 73 6f 20 6c 69 6b 65 20 5c 66 42 25 7a   also like \fB%z
8d30: 5c 66 52 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 61  \fR optionally a
8d40: 70 70 6c 69 63 61 62 6c 65 20 6f 6e 20 69 6e 70  pplicable on inp
8d50: 75 74 29 2e 0a 54 68 69 73 20 6f 70 74 69 6f 6e  ut)..This option
8d60: 20 73 68 6f 75 6c 64 2c 20 69 6e 20 67 65 6e 65   should, in gene
8d70: 72 61 6c 2c 20 62 65 20 75 73 65 64 20 6f 6e 20  ral, be used on 
8d80: 69 6e 70 75 74 20 6f 6e 6c 79 20 77 68 65 6e 0a  input only when.
8d90: 70 61 72 73 69 6e 67 20 52 46 43 38 32 32 20 64  parsing RFC822 d
8da0: 61 74 65 73 2e 20 4f 74 68 65 72 20 75 73 65 73  ates. Other uses
8db0: 20 61 72 65 20 66 72 61 75 67 68 74 20 77 69 74   are fraught wit
8dc0: 68 20 61 6d 62 69 67 75 69 74 79 3b 20 66 6f 72  h ambiguity; for
8dd0: 0a 69 6e 73 74 61 6e 63 65 2c 20 74 68 65 20 73  .instance, the s
8de0: 74 72 69 6e 67 20 5c 66 42 42 53 54 5c 66 52 20  tring \fBBST\fR 
8df0: 6d 61 79 20 72 65 70 72 65 73 65 6e 74 20 42 72  may represent Br
8e00: 69 74 69 73 68 20 53 75 6d 6d 65 72 20 54 69 6d  itish Summer Tim
8e10: 65 20 6f 72 0a 42 72 61 7a 69 6c 69 61 6e 20 53  e or.Brazilian S
8e20: 74 61 6e 64 61 72 64 20 54 69 6d 65 2e 20 49 74  tandard Time. It
8e30: 20 69 73 20 72 65 63 6f 6d 6d 65 6e 64 65 64 20   is recommended 
8e40: 74 68 61 74 20 64 61 74 65 2f 74 69 6d 65 20 73  that date/time s
8e50: 74 72 69 6e 67 73 20 66 6f 72 0a 75 73 65 20 62  trings for.use b
8e60: 79 20 63 6f 6d 70 75 74 65 72 73 20 75 73 65 20  y computers use 
8e70: 6e 75 6d 65 72 69 63 20 74 69 6d 65 20 7a 6f 6e  numeric time zon
8e80: 65 73 20 69 6e 73 74 65 61 64 2e 0a 2e 49 50 20  es instead...IP 
8e90: 5c 66 42 25 25 5c 66 52 0a 4f 6e 20 6f 75 74 70  \fB%%\fR.On outp
8ea0: 75 74 2c 20 70 72 6f 64 75 63 65 73 20 61 20 6c  ut, produces a l
8eb0: 69 74 65 72 61 6c 0a 2e 51 57 20 5c 66 42 25 5c  iteral..QW \fB%\
8ec0: 66 52 0a 63 68 61 72 61 63 74 65 72 2e 20 4f 6e  fR.character. On
8ed0: 20 69 6e 70 75 74 2c 20 6d 61 74 63 68 65 73 20   input, matches 
8ee0: 61 20 6c 69 74 65 72 61 6c 0a 2e 51 57 20 5c 66  a literal..QW \f
8ef0: 42 25 5c 66 52 0a 63 68 61 72 61 63 74 65 72 2e  B%\fR.character.
8f00: 0a 2e 49 50 20 5c 66 42 25 2b 5c 66 52 0a 53 79  ..IP \fB%+\fR.Sy
8f10: 6e 6f 6e 79 6d 6f 75 73 20 77 69 74 68 0a 2e 51  nonymous with..Q
8f20: 57 20 22 5c 66 42 25 61 20 25 62 20 25 65 20 25  W "\fB%a %b %e %
8f30: 48 3a 25 4d 3a 25 53 20 25 5a 20 25 59 5c 66 52  H:%M:%S %Z %Y\fR
8f40: 22 20 2e 0a 2e 53 48 20 22 54 49 4d 45 20 5a 4f  " ...SH "TIME ZO
8f50: 4e 45 53 22 0a 2e 50 50 0a 57 68 65 6e 20 74 68  NES"..PP.When th
8f60: 65 20 5c 66 42 63 6c 6f 63 6b 5c 66 52 20 63 6f  e \fBclock\fR co
8f70: 6d 6d 61 6e 64 20 69 73 20 70 72 6f 63 65 73 73  mmand is process
8f80: 69 6e 67 20 61 20 6c 6f 63 61 6c 20 74 69 6d 65  ing a local time
8f90: 2c 20 69 74 20 68 61 73 20 73 65 76 65 72 61 6c  , it has several
8fa0: 0a 70 6f 73 73 69 62 6c 65 20 73 6f 75 72 63 65  .possible source
8fb0: 73 20 66 6f 72 20 74 68 65 20 74 69 6d 65 20 7a  s for the time z
8fc0: 6f 6e 65 20 74 6f 20 75 73 65 2e 20 20 49 6e 20  one to use.  In 
8fd0: 6f 72 64 65 72 20 6f 66 20 70 72 65 66 65 72 65  order of prefere
8fe0: 6e 63 65 2c 20 74 68 65 79 0a 61 72 65 3a 0a 2e  nce, they.are:..
8ff0: 49 50 20 5b 31 5d 0a 41 20 74 69 6d 65 20 7a 6f  IP [1].A time zo
9000: 6e 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 73  ne specified ins
9010: 69 64 65 20 61 20 73 74 72 69 6e 67 20 62 65 69  ide a string bei
9020: 6e 67 20 70 61 72 73 65 64 20 61 6e 64 20 6d 61  ng parsed and ma
9030: 74 63 68 65 64 20 62 79 20 61 20 5c 66 42 25 7a  tched by a \fB%z
9040: 5c 66 52 0a 6f 72 20 5c 66 42 25 5a 5c 66 52 20  \fR.or \fB%Z\fR 
9050: 66 6f 72 6d 61 74 20 67 72 6f 75 70 2e 0a 2e 49  format group...I
9060: 50 20 5b 32 5d 0a 41 20 74 69 6d 65 20 7a 6f 6e  P [2].A time zon
9070: 65 20 73 70 65 63 69 66 69 65 64 20 77 69 74 68  e specified with
9080: 20 74 68 65 20 5c 66 42 5c 2d 74 69 6d 65 7a 6f   the \fB\-timezo
9090: 6e 65 5c 66 52 20 6f 70 74 69 6f 6e 20 74 6f 20  ne\fR option to 
90a0: 74 68 65 20 5c 66 42 63 6c 6f 63 6b 5c 66 52 0a  the \fBclock\fR.
90b0: 63 6f 6d 6d 61 6e 64 20 28 6f 72 2c 20 65 71 75  command (or, equ
90c0: 69 76 61 6c 65 6e 74 6c 79 2c 20 62 79 20 5c 66  ivalently, by \f
90d0: 42 5c 2d 67 6d 74 20 31 5c 66 52 29 2e 0a 2e 49  B\-gmt 1\fR)...I
90e0: 50 20 5b 33 5d 0a 41 20 74 69 6d 65 20 7a 6f 6e  P [3].A time zon
90f0: 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 61  e specified in a
9100: 6e 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61  n environment va
9110: 72 69 61 62 6c 65 20 5c 66 42 54 43 4c 5f 54 5a  riable \fBTCL_TZ
9120: 5c 66 52 2e 0a 2e 49 50 20 5b 34 5d 0a 41 20 74  \fR...IP [4].A t
9130: 69 6d 65 20 7a 6f 6e 65 20 73 70 65 63 69 66 69  ime zone specifi
9140: 65 64 20 69 6e 20 61 6e 20 65 6e 76 69 72 6f 6e  ed in an environ
9150: 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 20 5c 66  ment variable \f
9160: 42 54 5a 5c 66 52 2e 0a 2e 49 50 20 5b 35 5d 0a  BTZ\fR...IP [5].
9170: 54 68 65 20 6c 6f 63 61 6c 20 74 69 6d 65 20 7a  The local time z
9180: 6f 6e 65 20 66 72 6f 6d 20 74 68 65 20 43 6f 6e  one from the Con
9190: 74 72 6f 6c 20 50 61 6e 65 6c 20 6f 6e 20 57 69  trol Panel on Wi
91a0: 6e 64 6f 77 73 20 73 79 73 74 65 6d 73 2e 0a 2e  ndows systems...
91b0: 49 50 20 5b 36 5d 0a 54 68 65 20 43 20 6c 69 62  IP [6].The C lib
91c0: 72 61 72 79 27 73 20 69 64 65 61 20 6f 66 20 74  rary's idea of t
91d0: 68 65 20 6c 6f 63 61 6c 20 74 69 6d 65 20 7a 6f  he local time zo
91e0: 6e 65 2c 20 61 73 20 64 65 66 69 6e 65 64 20 62  ne, as defined b
91f0: 79 20 74 68 65 0a 5c 66 42 6d 6b 74 69 6d 65 5c  y the.\fBmktime\
9200: 66 52 20 61 6e 64 20 5c 66 42 6c 6f 63 61 6c 74  fR and \fBlocalt
9210: 69 6d 65 5c 66 52 20 66 75 6e 63 74 69 6f 6e 73  ime\fR functions
9220: 2e 0a 2e 50 50 0a 49 6e 20 63 61 73 65 20 5b 31  ...PP.In case [1
9230: 5d 20 5c 66 49 6f 6e 6c 79 2c 5c 66 52 20 74 68  ] \fIonly,\fR th
9240: 65 20 73 74 72 69 6e 67 20 69 73 20 74 65 73 74  e string is test
9250: 65 64 20 74 6f 20 73 65 65 20 69 66 20 69 74 20  ed to see if it 
9260: 69 73 20 6f 6e 65 0a 6f 66 20 74 68 65 20 73 74  is one.of the st
9270: 72 69 6e 67 73 3a 0a 2e 50 50 0a 2e 43 53 0a 20  rings:..PP..CS. 
9280: 67 6d 74 20 20 20 20 20 75 74 20 20 20 20 20 20  gmt     ut      
9290: 75 74 63 20 20 20 20 20 62 73 74 20 20 20 20 20  utc     bst     
92a0: 77 65 74 20 20 20 20 20 77 61 74 20 20 20 20 20  wet     wat     
92b0: 61 74 0a 20 6e 66 74 20 20 20 20 20 6e 73 74 20  at. nft     nst 
92c0: 20 20 20 20 6e 64 74 20 20 20 20 20 61 73 74 20      ndt     ast 
92d0: 20 20 20 20 61 64 74 20 20 20 20 20 65 73 74 20      adt     est 
92e0: 20 20 20 20 65 64 74 0a 20 63 73 74 20 20 20 20      edt. cst    
92f0: 20 63 64 74 20 20 20 20 20 6d 73 74 20 20 20 20   cdt     mst    
9300: 20 6d 64 74 20 20 20 20 20 70 73 74 20 20 20 20   mdt     pst    
9310: 20 70 64 74 20 20 20 20 20 79 73 74 0a 20 79 64   pdt     yst. yd
9320: 74 20 20 20 20 20 68 73 74 20 20 20 20 20 68 64  t     hst     hd
9330: 74 20 20 20 20 20 63 61 74 20 20 20 20 20 61 68  t     cat     ah
9340: 73 74 20 20 20 20 6e 74 20 20 20 20 20 20 69 64  st    nt      id
9350: 6c 77 0a 20 63 65 74 20 20 20 20 20 63 65 73 74  lw. cet     cest
9360: 20 20 20 20 6d 65 74 20 20 20 20 20 6d 65 77 74      met     mewt
9370: 20 20 20 20 6d 65 73 74 20 20 20 20 73 77 74 20      mest    swt 
9380: 20 20 20 20 73 73 74 0a 20 65 65 74 20 20 20 20      sst. eet    
9390: 20 65 65 73 74 20 20 20 20 62 74 20 20 20 20 20   eest    bt     
93a0: 20 69 74 20 20 20 20 20 20 7a 70 34 20 20 20 20   it      zp4    
93b0: 20 7a 70 35 20 20 20 20 20 69 73 74 0a 20 7a 70   zp5     ist. zp
93c0: 36 20 20 20 20 20 77 61 73 74 20 20 20 20 77 61  6     wast    wa
93d0: 64 74 20 20 20 20 6a 74 20 20 20 20 20 20 63 63  dt    jt      cc
93e0: 74 20 20 20 20 20 6a 73 74 20 20 20 20 20 63 61  t     jst     ca
93f0: 73 74 0a 20 63 61 64 74 20 20 20 20 65 61 73 74  st. cadt    east
9400: 20 20 20 20 65 61 64 74 20 20 20 20 67 73 74 20      eadt    gst 
9410: 20 20 20 20 6e 7a 74 20 20 20 20 20 6e 7a 73 74      nzt     nzst
9420: 20 20 20 20 6e 7a 64 74 0a 20 69 64 6c 65 0a 2e      nzdt. idle..
9430: 43 45 0a 2e 50 50 0a 49 66 20 69 74 20 69 73 20  CE..PP.If it is 
9440: 61 20 73 74 72 69 6e 67 20 69 6e 20 74 68 65 20  a string in the 
9450: 61 62 6f 76 65 20 6c 69 73 74 2c 20 69 74 20 64  above list, it d
9460: 65 73 69 67 6e 61 74 65 73 20 61 20 6b 6e 6f 77  esignates a know
9470: 6e 0a 74 69 6d 65 20 7a 6f 6e 65 2c 20 61 6e 64  n.time zone, and
9480: 20 69 73 20 69 6e 74 65 72 70 72 65 74 65 64 20   is interpreted 
9490: 61 73 20 73 75 63 68 2e 0a 2e 50 50 0a 46 6f 72  as such...PP.For
94a0: 20 74 69 6d 65 20 7a 6f 6e 65 73 20 69 6e 20 63   time zones in c
94b0: 61 73 65 20 5b 31 5d 20 74 68 61 74 20 64 6f 20  ase [1] that do 
94c0: 6e 6f 74 20 6d 61 74 63 68 20 61 6e 79 20 6f 66  not match any of
94d0: 20 74 68 65 20 61 62 6f 76 65 20 73 74 72 69 6e   the above strin
94e0: 67 73 2c 0a 61 6e 64 20 61 6c 77 61 79 73 20 66  gs,.and always f
94f0: 6f 72 20 63 61 73 65 73 20 5b 32 5d 2d 5b 36 5d  or cases [2]-[6]
9500: 2c 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20  , the following 
9510: 72 75 6c 65 73 20 61 70 70 6c 79 2e 0a 2e 50 50  rules apply...PP
9520: 0a 49 66 20 74 68 65 20 74 69 6d 65 20 7a 6f 6e  .If the time zon
9530: 65 20 62 65 67 69 6e 73 20 77 69 74 68 20 61 20  e begins with a 
9540: 63 6f 6c 6f 6e 2c 20 69 74 20 69 73 20 6f 6e 65  colon, it is one
9550: 20 6f 66 20 61 0a 73 74 61 6e 64 61 72 64 69 7a   of a.standardiz
9560: 65 64 20 6c 69 73 74 20 6f 66 20 6e 61 6d 65 73  ed list of names
9570: 20 6c 69 6b 65 20 5c 66 42 3a 41 6d 65 72 69 63   like \fB:Americ
9580: 61 2f 4e 65 77 5f 59 6f 72 6b 5c 66 52 0a 74 68  a/New_York\fR.th
9590: 61 74 20 67 69 76 65 20 74 68 65 20 72 75 6c 65  at give the rule
95a0: 73 20 66 6f 72 20 76 61 72 69 6f 75 73 20 6c 6f  s for various lo
95b0: 63 61 6c 65 73 2e 20 20 41 20 63 6f 6d 70 6c 65  cales.  A comple
95c0: 74 65 20 6c 69 73 74 0a 6f 66 20 74 68 65 20 6c  te list.of the l
95d0: 6f 63 61 74 69 6f 6e 20 6e 61 6d 65 73 20 69 73  ocation names is
95e0: 20 74 6f 6f 20 6c 65 6e 67 74 68 79 20 74 6f 20   too lengthy to 
95f0: 62 65 20 6c 69 73 74 65 64 20 68 65 72 65 2e 0a  be listed here..
9600: 4f 6e 20 6d 6f 73 74 20 54 63 6c 20 69 6e 73 74  On most Tcl inst
9610: 61 6c 6c 61 74 69 6f 6e 73 2c 20 74 68 65 20 64  allations, the d
9620: 65 66 69 6e 69 74 69 6f 6e 73 20 6f 66 20 74 68  efinitions of th
9630: 65 20 6c 6f 63 61 74 69 6f 6e 73 0a 61 72 65 20  e locations.are 
9640: 74 6f 20 62 65 20 66 6f 75 6e 64 20 69 6e 20 6e  to be found in n
9650: 61 6d 65 64 20 66 69 6c 65 73 20 69 6e 20 74 68  amed files in th
9660: 65 20 64 69 72 65 63 74 6f 72 79 0a 2e 51 57 20  e directory..QW 
9670: 22 5c 66 49 2f 6e 6f 5f 62 61 63 6b 75 70 2f 74  "\fI/no_backup/t
9680: 6f 6f 6c 73 2f 6c 69 62 2f 74 63 6c 38 2e 35 2f  ools/lib/tcl8.5/
9690: 63 6c 6f 63 6b 2f 74 7a 64 61 74 61 5c 66 52 22  clock/tzdata\fR"
96a0: 20 2e 0a 4f 6e 20 73 6f 6d 65 20 55 6e 69 78 20   ..On some Unix 
96b0: 73 79 73 74 65 6d 73 2c 20 74 68 65 73 65 20 66  systems, these f
96c0: 69 6c 65 73 20 61 72 65 20 6f 6d 69 74 74 65 64  iles are omitted
96d0: 2c 20 61 6e 64 20 74 68 65 20 64 65 66 69 6e 69  , and the defini
96e0: 74 69 6f 6e 73 20 61 72 65 0a 69 6e 73 74 65 61  tions are.instea
96f0: 64 20 6f 62 74 61 69 6e 65 64 20 66 72 6f 6d 20  d obtained from 
9700: 73 79 73 74 65 6d 20 66 69 6c 65 73 20 69 6e 0a  system files in.
9710: 2e 51 57 20 22 5c 66 49 2f 75 73 72 2f 73 68 61  .QW "\fI/usr/sha
9720: 72 65 2f 7a 6f 6e 65 69 6e 66 6f 5c 66 52 22 20  re/zoneinfo\fR" 
9730: 2c 0a 2e 51 57 20 22 5c 66 49 2f 75 73 72 2f 73  ,..QW "\fI/usr/s
9740: 68 61 72 65 2f 6c 69 62 2f 7a 6f 6e 65 69 6e 66  hare/lib/zoneinf
9750: 6f 5c 66 52 22 0a 6f 72 0a 2e 51 57 20 22 5c 66  o\fR".or..QW "\f
9760: 49 2f 75 73 72 2f 6c 6f 63 61 6c 2f 65 74 63 2f  I/usr/local/etc/
9770: 7a 6f 6e 65 69 6e 66 6f 5c 66 52 22 20 2e 0a 41  zoneinfo\fR" ..A
9780: 73 20 61 20 73 70 65 63 69 61 6c 20 63 61 73 65  s a special case
9790: 2c 20 74 68 65 20 6e 61 6d 65 20 5c 66 42 3a 6c  , the name \fB:l
97a0: 6f 63 61 6c 74 69 6d 65 5c 66 52 20 72 65 66 65  ocaltime\fR refe
97b0: 72 73 20 74 6f 0a 74 68 65 20 6c 6f 63 61 6c 20  rs to.the local 
97c0: 74 69 6d 65 20 7a 6f 6e 65 20 61 73 20 64 65 66  time zone as def
97d0: 69 6e 65 64 20 62 79 20 74 68 65 20 43 20 6c 69  ined by the C li
97e0: 62 72 61 72 79 2e 0a 2e 50 50 0a 41 20 74 69 6d  brary...PP.A tim
97f0: 65 20 7a 6f 6e 65 20 73 74 72 69 6e 67 20 63 6f  e zone string co
9800: 6e 73 69 73 74 69 6e 67 20 6f 66 20 61 20 70 6c  nsisting of a pl
9810: 75 73 20 6f 72 20 6d 69 6e 75 73 20 73 69 67 6e  us or minus sign
9820: 20 66 6f 6c 6c 6f 77 65 64 20 62 79 0a 66 6f 75   followed by.fou
9830: 72 20 6f 72 20 73 69 78 20 64 65 63 69 6d 61 6c  r or six decimal
9840: 20 64 69 67 69 74 73 20 69 73 20 69 6e 74 65 72   digits is inter
9850: 70 72 65 74 65 64 20 61 73 20 61 6e 20 6f 66 66  preted as an off
9860: 73 65 74 20 69 6e 0a 68 6f 75 72 73 2c 20 6d 69  set in.hours, mi
9870: 6e 75 74 65 73 2c 20 61 6e 64 20 73 65 63 6f 6e  nutes, and secon
9880: 64 73 20 28 69 66 20 73 69 78 20 64 69 67 69 74  ds (if six digit
9890: 73 20 61 72 65 20 70 72 65 73 65 6e 74 29 20 66  s are present) f
98a0: 72 6f 6d 0a 55 54 43 2e 20 20 54 68 65 20 70 6c  rom.UTC.  The pl
98b0: 75 73 20 73 69 67 6e 20 64 65 6e 6f 74 65 73 20  us sign denotes 
98c0: 61 20 73 69 67 6e 20 65 61 73 74 20 6f 66 20 47  a sign east of G
98d0: 72 65 65 6e 77 69 63 68 3b 0a 74 68 65 20 6d 69  reenwich;.the mi
98e0: 6e 75 73 20 73 69 67 6e 20 6f 6e 65 20 77 65 73  nus sign one wes
98f0: 74 20 6f 66 20 47 72 65 65 6e 77 69 63 68 2e 0a  t of Greenwich..
9900: 2e 50 50 0a 41 20 74 69 6d 65 20 7a 6f 6e 65 20  .PP.A time zone 
9910: 73 74 72 69 6e 67 20 63 6f 6e 66 6f 72 6d 69 6e  string conformin
9920: 67 20 74 6f 20 74 68 65 20 50 6f 73 69 78 20 73  g to the Posix s
9930: 70 65 63 69 66 69 63 61 74 69 6f 6e 20 6f 66 20  pecification of 
9940: 74 68 65 20 5c 66 42 54 5a 5c 66 52 0a 65 6e 76  the \fBTZ\fR.env
9950: 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c  ironment variabl
9960: 65 20 77 69 6c 6c 20 62 65 20 72 65 63 6f 67 6e  e will be recogn
9970: 69 7a 65 64 2e 20 20 54 68 65 20 73 70 65 63 69  ized.  The speci
9980: 66 69 63 61 74 69 6f 6e 0a 6d 61 79 20 62 65 20  fication.may be 
9990: 66 6f 75 6e 64 20 61 74 0a 5c 66 49 68 74 74 70  found at.\fIhttp
99a0: 73 3a 2f 2f 70 75 62 73 2e 6f 70 65 6e 67 72 6f  s://pubs.opengro
99b0: 75 70 2e 6f 72 67 2f 6f 6e 6c 69 6e 65 70 75 62  up.org/onlinepub
99c0: 73 2f 30 30 39 36 39 35 33 39 39 2f 62 61 73 65  s/009695399/base
99d0: 64 65 66 73 2f 78 62 64 5f 63 68 61 70 30 38 2e  defs/xbd_chap08.
99e0: 68 74 6d 6c 5c 66 52 2e 0a 2e 50 50 0a 49 66 20  html\fR...PP.If 
99f0: 74 68 65 20 50 6f 73 69 78 20 74 69 6d 65 20 7a  the Posix time z
9a00: 6f 6e 65 20 73 74 72 69 6e 67 20 63 6f 6e 74 61  one string conta
9a10: 69 6e 73 20 61 20 44 53 54 20 28 44 61 79 6c 69  ins a DST (Dayli
9a20: 67 68 74 20 53 61 76 69 6e 67 73 20 54 69 6d 65  ght Savings Time
9a30: 29 0a 70 61 72 74 2c 20 62 75 74 20 64 6f 65 73  ).part, but does
9a40: 6e 27 74 20 63 6f 6e 74 61 69 6e 20 61 20 72 75  n't contain a ru
9a50: 6c 65 20 73 74 61 74 69 6e 67 20 77 68 65 6e 20  le stating when 
9a60: 44 53 54 20 73 74 61 72 74 73 20 6f 72 20 65 6e  DST starts or en
9a70: 64 73 2c 0a 74 68 65 6e 20 64 65 66 61 75 6c 74  ds,.then default
9a80: 20 72 75 6c 65 73 20 61 72 65 20 75 73 65 64 2e   rules are used.
9a90: 20 46 6f 72 20 54 69 6d 65 7a 6f 6e 65 73 20 77   For Timezones w
9aa0: 69 74 68 20 61 6e 20 6f 66 66 73 65 74 20 62 65  ith an offset be
9ab0: 74 77 65 65 6e 20 30 0a 61 6e 64 20 2b 31 32 2c  tween 0.and +12,
9ac0: 20 74 68 65 20 63 75 72 72 65 6e 74 20 45 75 72   the current Eur
9ad0: 6f 70 65 61 6e 2f 52 75 73 73 69 61 6e 20 72 75  opean/Russian ru
9ae0: 6c 65 73 20 61 72 65 20 75 73 65 64 2c 20 6f 74  les are used, ot
9af0: 68 65 72 77 69 73 65 20 74 68 65 0a 63 75 72 72  herwise the.curr
9b00: 65 6e 74 20 55 53 20 72 75 6c 65 73 20 61 72 65  ent US rules are
9b10: 20 75 73 65 64 2e 20 49 6e 20 45 75 72 6f 70 65   used. In Europe
9b20: 20 28 6f 66 66 73 65 74 20 2b 30 20 74 6f 20 2b   (offset +0 to +
9b30: 32 29 20 74 68 65 20 73 77 69 74 63 68 0a 74 6f  2) the switch.to
9b40: 20 73 75 6d 6d 65 72 74 69 6d 65 20 69 73 20 64   summertime is d
9b50: 6f 6e 65 20 65 61 63 68 20 6c 61 73 74 20 53 75  one each last Su
9b60: 6e 64 61 79 20 69 6e 20 4d 61 72 63 68 20 61 74  nday in March at
9b70: 20 31 3a 30 30 20 47 4d 54 2c 20 61 6e 64 0a 74   1:00 GMT, and.t
9b80: 68 65 20 73 77 69 74 63 68 20 62 61 63 6b 20 69  he switch back i
9b90: 73 20 65 61 63 68 20 6c 61 73 74 20 53 75 6e 64  s each last Sund
9ba0: 61 79 20 69 6e 20 4f 63 74 6f 62 65 72 20 61 74  ay in October at
9bb0: 20 32 3a 30 30 20 47 4d 54 2e 20 49 6e 0a 52 75   2:00 GMT. In.Ru
9bc0: 73 73 69 61 20 28 6f 66 66 73 65 74 20 2b 33 20  ssia (offset +3 
9bd0: 74 6f 20 2b 31 32 29 2c 20 74 68 65 20 73 77 69  to +12), the swi
9be0: 74 63 68 20 64 61 74 65 73 20 61 72 65 20 74 68  tch dates are th
9bf0: 65 20 73 61 6d 65 2c 20 6f 6e 6c 79 0a 74 68 65  e same, only.the
9c00: 20 73 77 69 74 63 68 20 74 6f 20 73 75 6d 6d 65   switch to summe
9c10: 72 74 69 6d 65 20 69 73 20 61 74 20 32 3a 30 30  rtime is at 2:00
9c20: 20 6c 6f 63 61 6c 20 74 69 6d 65 2c 20 61 6e 64   local time, and
9c30: 20 74 68 65 20 73 77 69 74 63 68 0a 62 61 63 6b   the switch.back
9c40: 20 69 73 20 61 74 20 33 3a 30 30 20 6c 6f 63 61   is at 3:00 loca
9c50: 6c 20 74 69 6d 65 20 69 6e 20 61 6c 6c 20 74 69  l time in all ti
9c60: 6d 65 20 7a 6f 6e 65 73 2e 20 54 68 65 20 55 53  me zones. The US
9c70: 20 73 77 69 74 63 68 20 74 6f 0a 73 75 6d 6d 65   switch to.summe
9c80: 72 74 69 6d 65 20 74 61 6b 65 73 20 70 6c 61 63  rtime takes plac
9c90: 65 20 65 61 63 68 20 73 65 63 6f 6e 64 20 53 75  e each second Su
9ca0: 6e 64 61 79 20 69 6e 20 4d 61 72 63 68 20 61 74  nday in March at
9cb0: 20 32 3a 30 30 20 6c 6f 63 61 6c 0a 74 69 6d 65   2:00 local.time
9cc0: 2c 20 61 6e 64 20 74 68 65 20 73 77 69 74 63 68  , and the switch
9cd0: 20 62 61 63 6b 20 69 73 20 65 61 63 68 20 66 69   back is each fi
9ce0: 72 73 74 20 53 75 6e 64 61 79 20 69 6e 20 4e 6f  rst Sunday in No
9cf0: 76 65 6d 62 65 72 20 61 74 0a 33 3a 30 30 20 6c  vember at.3:00 l
9d00: 6f 63 61 6c 20 74 69 6d 65 2e 20 54 68 65 73 65  ocal time. These
9d10: 20 64 65 66 61 75 6c 74 20 72 75 6c 65 73 20 6d   default rules m
9d20: 65 61 6e 20 74 68 61 74 20 69 6e 20 61 6c 6c 20  ean that in all 
9d30: 45 75 72 6f 70 65 61 6e 2c 0a 52 75 73 73 69 61  European,.Russia
9d40: 6e 20 61 6e 64 20 55 53 20 28 6f 72 20 63 6f 6d  n and US (or com
9d50: 70 61 74 69 62 6c 65 29 20 74 69 6d 65 20 7a 6f  patible) time zo
9d60: 6e 65 73 2c 20 44 53 54 20 63 61 6c 63 75 6c 61  nes, DST calcula
9d70: 74 69 6f 6e 73 20 77 69 6c 6c 0a 62 65 20 63 6f  tions will.be co
9d80: 72 72 65 63 74 20 66 6f 72 20 64 61 74 65 73 20  rrect for dates 
9d90: 69 6e 20 32 30 30 37 20 61 6e 64 20 6c 61 74 65  in 2007 and late
9da0: 72 2c 20 75 6e 6c 65 73 73 20 69 6e 20 74 68 65  r, unless in the
9db0: 20 66 75 74 75 72 65 20 74 68 65 0a 72 75 6c 65   future the.rule
9dc0: 73 20 63 68 61 6e 67 65 20 61 67 61 69 6e 2e 0a  s change again..
9dd0: 2e 50 50 0a 41 6e 79 20 6f 74 68 65 72 20 74 69  .PP.Any other ti
9de0: 6d 65 20 7a 6f 6e 65 20 73 74 72 69 6e 67 20 69  me zone string i
9df0: 73 20 70 72 6f 63 65 73 73 65 64 20 62 79 20 70  s processed by p
9e00: 72 65 66 69 78 69 6e 67 20 61 20 63 6f 6c 6f 6e  refixing a colon
9e10: 20 61 6e 64 20 61 74 74 65 6d 70 74 69 6e 67 0a   and attempting.
9e20: 74 6f 20 75 73 65 20 69 74 20 61 73 20 61 20 6c  to use it as a l
9e30: 6f 63 61 74 69 6f 6e 20 6e 61 6d 65 2c 20 61 73  ocation name, as
9e40: 20 61 62 6f 76 65 2e 0a 2e 53 48 20 22 4c 4f 43   above...SH "LOC
9e50: 41 4c 49 5a 41 54 49 4f 4e 22 0a 2e 50 50 0a 44  ALIZATION"..PP.D
9e60: 65 76 65 6c 6f 70 65 72 73 20 77 69 73 68 69 6e  evelopers wishin
9e70: 67 20 74 6f 20 6c 6f 63 61 6c 69 7a 65 20 74 68  g to localize th
9e80: 65 20 64 61 74 65 20 61 6e 64 20 74 69 6d 65 20  e date and time 
9e90: 66 6f 72 6d 61 74 74 69 6e 67 20 61 6e 64 20 70  formatting and p
9ea0: 61 72 73 69 6e 67 0a 61 72 65 20 72 65 66 65 72  arsing.are refer
9eb0: 72 65 64 20 74 6f 20 5c 66 49 68 74 74 70 73 3a  red to \fIhttps:
9ec0: 2f 2f 74 69 70 2e 74 63 6c 2d 6c 61 6e 67 2e 6f  //tip.tcl-lang.o
9ed0: 72 67 2f 31 37 33 5c 66 52 20 66 6f 72 20 61 0a  rg/173\fR for a.
9ee0: 73 70 65 63 69 66 69 63 61 74 69 6f 6e 2e 0a 2e  specification...
9ef0: 53 48 20 22 46 52 45 45 20 46 4f 52 4d 20 53 43  SH "FREE FORM SC
9f00: 41 4e 22 0a 2e 50 50 0a 49 66 20 74 68 65 20 5c  AN"..PP.If the \
9f10: 66 42 63 6c 6f 63 6b 20 73 63 61 6e 5c 66 52 20  fBclock scan\fR 
9f20: 63 6f 6d 6d 61 6e 64 20 69 73 20 69 6e 76 6f 6b  command is invok
9f30: 65 64 20 77 69 74 68 6f 75 74 20 61 20 5c 66 42  ed without a \fB
9f40: 5c 2d 66 6f 72 6d 61 74 5c 66 52 0a 6f 70 74 69  \-format\fR.opti
9f50: 6f 6e 2c 20 74 68 65 6e 20 69 74 20 72 65 71 75  on, then it requ
9f60: 65 73 74 73 20 61 20 5c 66 49 66 72 65 65 2d 66  ests a \fIfree-f
9f70: 6f 72 6d 20 73 63 61 6e 5c 66 52 2e 0a 5c 66 49  orm scan\fR..\fI
9f80: 54 68 69 73 20 66 6f 72 6d 20 6f 66 20 73 63 61  This form of sca
9f90: 6e 20 69 73 20 64 65 70 72 65 63 61 74 65 64 2e  n is deprecated.
9fa0: 5c 66 52 0a 54 68 65 20 72 65 61 73 6f 6e 20 66  \fR.The reason f
9fb0: 6f 72 20 74 68 65 20 64 65 70 72 65 63 61 74 69  or the deprecati
9fc0: 6f 6e 0a 69 73 20 74 68 61 74 20 74 68 65 72 65  on.is that there
9fd0: 20 61 72 65 20 74 6f 6f 20 6d 61 6e 79 20 61 6d   are too many am
9fe0: 62 69 67 75 69 74 69 65 73 2e 20 28 44 6f 65 73  biguities. (Does
9ff0: 20 74 68 65 20 73 74 72 69 6e 67 0a 2e 51 57 20   the string..QW 
a000: 32 30 30 30 0a 72 65 70 72 65 73 65 6e 74 20 61  2000.represent a
a010: 20 79 65 61 72 2c 20 61 20 74 69 6d 65 20 6f 66   year, a time of
a020: 20 64 61 79 2c 20 6f 72 20 61 20 71 75 61 6e 74   day, or a quant
a030: 69 74 79 3f 29 20 20 4e 6f 20 73 65 74 20 6f 66  ity?)  No set of
a040: 20 72 75 6c 65 73 0a 66 6f 72 20 69 6e 74 65 72   rules.for inter
a050: 70 72 65 74 69 6e 67 20 66 72 65 65 2d 66 6f 72  preting free-for
a060: 6d 20 64 61 74 65 73 20 61 6e 64 20 74 69 6d 65  m dates and time
a070: 73 20 68 61 73 20 62 65 65 6e 20 66 6f 75 6e 64  s has been found
a080: 20 74 6f 0a 67 69 76 65 20 75 6e 73 75 72 70 72   to.give unsurpr
a090: 69 73 69 6e 67 20 72 65 73 75 6c 74 73 20 69 6e  ising results in
a0a0: 20 61 6c 6c 20 63 61 73 65 73 2e 0a 2e 50 50 0a   all cases...PP.
a0b0: 49 66 20 66 72 65 65 2d 66 6f 72 6d 20 73 63 61  If free-form sca
a0c0: 6e 20 69 73 20 75 73 65 64 2c 20 6f 6e 6c 79 20  n is used, only 
a0d0: 74 68 65 20 5c 66 42 5c 2d 62 61 73 65 5c 66 52  the \fB\-base\fR
a0e0: 20 61 6e 64 20 5c 66 42 5c 2d 67 6d 74 5c 66 52   and \fB\-gmt\fR
a0f0: 0a 6f 70 74 69 6f 6e 73 20 61 72 65 20 61 63 63  .options are acc
a100: 65 70 74 65 64 2e 20 20 54 68 65 20 5c 66 42 5c  epted.  The \fB\
a110: 2d 74 69 6d 65 7a 6f 6e 65 5c 66 52 20 61 6e 64  -timezone\fR and
a120: 20 5c 66 42 5c 2d 6c 6f 63 61 6c 65 5c 66 52 0a   \fB\-locale\fR.
a130: 6f 70 74 69 6f 6e 73 20 77 69 6c 6c 20 72 65 73  options will res
a140: 75 6c 74 20 69 6e 20 61 6e 20 65 72 72 6f 72 20  ult in an error 
a150: 69 66 20 5c 66 42 5c 2d 66 6f 72 6d 61 74 5c 66  if \fB\-format\f
a160: 52 20 69 73 20 6e 6f 74 20 73 75 70 70 6c 69 65  R is not supplie
a170: 64 2e 0a 2e 50 50 0a 46 6f 72 20 74 68 65 20 62  d...PP.For the b
a180: 65 6e 65 66 69 74 20 6f 66 20 75 73 65 72 73 20  enefit of users 
a190: 77 68 6f 20 6e 65 65 64 20 74 6f 20 75 6e 64 65  who need to unde
a1a0: 72 73 74 61 6e 64 20 6c 65 67 61 63 79 20 63 6f  rstand legacy co
a1b0: 64 65 20 74 68 61 74 0a 75 73 65 73 20 66 72 65  de that.uses fre
a1c0: 65 2d 66 6f 72 6d 20 73 63 61 6e 2c 20 74 68 65  e-form scan, the
a1d0: 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66   documentation f
a1e0: 6f 72 20 68 6f 77 20 66 72 65 65 2d 66 6f 72 6d  or how free-form
a1f0: 20 73 63 61 6e 0a 69 6e 74 65 72 70 72 65 74 73   scan.interprets
a200: 20 61 20 73 74 72 69 6e 67 20 69 73 20 69 6e 63   a string is inc
a210: 6c 75 64 65 64 20 68 65 72 65 3a 0a 2e 50 50 0a  luded here:..PP.
a220: 49 66 20 6f 6e 6c 79 20 61 20 74 69 6d 65 20 69  If only a time i
a230: 73 0a 73 70 65 63 69 66 69 65 64 2c 20 74 68 65  s.specified, the
a240: 20 63 75 72 72 65 6e 74 20 64 61 74 65 20 69 73   current date is
a250: 20 61 73 73 75 6d 65 64 2e 20 20 49 66 20 74 68   assumed.  If th
a260: 65 20 5c 66 49 69 6e 70 75 74 53 74 72 69 6e 67  e \fIinputString
a270: 5c 66 52 0a 64 6f 65 73 20 6e 6f 74 20 63 6f 6e  \fR.does not con
a280: 74 61 69 6e 20 61 0a 74 69 6d 65 20 7a 6f 6e 65  tain a.time zone
a290: 20 6d 6e 65 6d 6f 6e 69 63 2c 20 74 68 65 20 6c   mnemonic, the l
a2a0: 6f 63 61 6c 20 74 69 6d 65 20 7a 6f 6e 65 20 69  ocal time zone i
a2b0: 73 20 61 73 73 75 6d 65 64 2c 20 75 6e 6c 65 73  s assumed, unles
a2c0: 73 20 74 68 65 20 5c 66 42 5c 2d 67 6d 74 5c 66  s the \fB\-gmt\f
a2d0: 52 0a 61 72 67 75 6d 65 6e 74 20 69 73 20 74 72  R.argument is tr
a2e0: 75 65 2c 20 69 6e 20 77 68 69 63 68 20 63 61 73  ue, in which cas
a2f0: 65 20 74 68 65 20 63 6c 6f 63 6b 20 76 61 6c 75  e the clock valu
a300: 65 20 69 73 20 63 61 6c 63 75 6c 61 74 65 64 20  e is calculated 
a310: 61 73 73 75 6d 69 6e 67 0a 74 68 61 74 20 74 68  assuming.that th
a320: 65 20 73 70 65 63 69 66 69 65 64 20 74 69 6d 65  e specified time
a330: 20 69 73 20 72 65 6c 61 74 69 76 65 20 74 6f 20   is relative to 
a340: 47 72 65 65 6e 77 69 63 68 20 4d 65 61 6e 20 54  Greenwich Mean T
a350: 69 6d 65 2e 0a 5c 66 42 5c 2d 67 6d 74 5c 66 52  ime..\fB\-gmt\fR
a360: 2c 20 69 66 20 73 70 65 63 69 66 69 65 64 2c 20  , if specified, 
a370: 61 66 66 65 63 74 73 20 6f 6e 6c 79 20 74 68 65  affects only the
a380: 20 63 6f 6d 70 75 74 65 64 20 74 69 6d 65 20 76   computed time v
a390: 61 6c 75 65 3b 20 69 74 20 64 6f 65 73 20 6e 6f  alue; it does no
a3a0: 74 0a 69 6d 70 61 63 74 20 74 68 65 20 69 6e 74  t.impact the int
a3b0: 65 72 70 72 65 74 61 74 69 6f 6e 20 6f 66 20 5c  erpretation of \
a3c0: 66 42 5c 2d 62 61 73 65 5c 66 52 2e 0a 2e 50 50  fB\-base\fR...PP
a3d0: 0a 49 66 20 74 68 65 20 5c 66 42 5c 2d 62 61 73  .If the \fB\-bas
a3e0: 65 5c 66 52 20 66 6c 61 67 20 69 73 20 73 70 65  e\fR flag is spe
a3f0: 63 69 66 69 65 64 2c 20 74 68 65 20 6e 65 78 74  cified, the next
a400: 20 61 72 67 75 6d 65 6e 74 20 73 68 6f 75 6c 64   argument should
a410: 20 63 6f 6e 74 61 69 6e 0a 61 6e 20 69 6e 74 65   contain.an inte
a420: 67 65 72 20 63 6c 6f 63 6b 20 76 61 6c 75 65 2e  ger clock value.
a430: 20 20 4f 6e 6c 79 20 74 68 65 20 64 61 74 65 20    Only the date 
a440: 69 6e 20 74 68 69 73 20 76 61 6c 75 65 20 69 73  in this value is
a450: 20 75 73 65 64 2c 20 6e 6f 74 20 74 68 65 0a 74   used, not the.t
a460: 69 6d 65 2e 20 20 54 68 69 73 20 69 73 20 75 73  ime.  This is us
a470: 65 66 75 6c 20 66 6f 72 20 64 65 74 65 72 6d 69  eful for determi
a480: 6e 69 6e 67 20 74 68 65 20 74 69 6d 65 20 6f 6e  ning the time on
a490: 20 61 20 73 70 65 63 69 66 69 63 20 64 61 79 20   a specific day 
a4a0: 6f 72 0a 64 6f 69 6e 67 20 6f 74 68 65 72 20 64  or.doing other d
a4b0: 61 74 65 2d 72 65 6c 61 74 69 76 65 20 63 6f 6e  ate-relative con
a4c0: 76 65 72 73 69 6f 6e 73 2e 0a 2e 50 50 0a 54 68  versions...PP.Th
a4d0: 65 20 5c 66 49 69 6e 70 75 74 53 74 72 69 6e 67  e \fIinputString
a4e0: 5c 66 52 20 61 72 67 75 6d 65 6e 74 20 63 6f 6e  \fR argument con
a4f0: 73 69 73 74 73 20 6f 66 20 7a 65 72 6f 20 6f 72  sists of zero or
a500: 20 6d 6f 72 65 20 73 70 65 63 69 66 69 63 61 74   more specificat
a510: 69 6f 6e 73 20 6f 66 20 74 68 65 0a 66 6f 6c 6c  ions of the.foll
a520: 6f 77 69 6e 67 20 66 6f 72 6d 3a 0a 2e 54 50 0a  owing form:..TP.
a530: 5c 66 49 74 69 6d 65 5c 66 52 0a 2e 0a 41 20 74  \fItime\fR...A t
a540: 69 6d 65 20 6f 66 20 64 61 79 2c 20 77 68 69 63  ime of day, whic
a550: 68 20 69 73 20 6f 66 20 74 68 65 20 66 6f 72 6d  h is of the form
a560: 3a 0a 2e 51 57 20 22 5c 66 49 68 68 5c 66 52 3f  :..QW "\fIhh\fR?
a570: 5c 66 42 3a 5c 66 49 6d 6d 5c 66 52 3f 5c 66 42  \fB:\fImm\fR?\fB
a580: 3a 5c 66 49 73 73 5c 66 52 3f 3f 20 3f 5c 66 49  :\fIss\fR?? ?\fI
a590: 6d 65 72 69 64 69 61 6e 5c 66 52 3f 20 3f 5c 66  meridian\fR? ?\f
a5a0: 49 7a 6f 6e 65 5c 66 52 3f 22 0a 6f 72 0a 2e 51  Izone\fR?".or..Q
a5b0: 57 20 22 5c 66 42 68 68 6d 6d 20 5c 66 52 3f 5c  W "\fBhhmm \fR?\
a5c0: 66 42 6d 65 72 69 64 69 61 6e 5c 66 52 3f 20 3f  fBmeridian\fR? ?
a5d0: 5c 66 42 7a 6f 6e 65 5c 66 52 3f 22 20 2e 0a 49  \fBzone\fR?" ..I
a5e0: 66 20 6e 6f 20 5c 66 49 6d 65 72 69 64 69 61 6e  f no \fImeridian
a5f0: 5c 66 52 20 69 73 20 73 70 65 63 69 66 69 65 64  \fR is specified
a600: 2c 20 5c 66 49 68 68 5c 66 52 20 69 73 20 69 6e  , \fIhh\fR is in
a610: 74 65 72 70 72 65 74 65 64 20 6f 6e 0a 61 20 32  terpreted on.a 2
a620: 34 2d 68 6f 75 72 20 63 6c 6f 63 6b 2e 0a 2e 54  4-hour clock...T
a630: 50 0a 5c 66 49 64 61 74 65 5c 66 52 0a 2e 0a 41  P.\fIdate\fR...A
a640: 20 73 70 65 63 69 66 69 63 20 6d 6f 6e 74 68 20   specific month 
a650: 61 6e 64 20 64 61 79 20 77 69 74 68 20 6f 70 74  and day with opt
a660: 69 6f 6e 61 6c 20 79 65 61 72 2e 20 20 54 68 65  ional year.  The
a670: 0a 61 63 63 65 70 74 61 62 6c 65 20 66 6f 72 6d  .acceptable form
a680: 61 74 73 20 61 72 65 0a 2e 51 57 20 22 5c 66 49  ats are..QW "\fI
a690: 6d 6d 5c 66 42 2f 5c 66 49 64 64 5c 66 52 3f 5c  mm\fB/\fIdd\fR?\
a6a0: 66 42 2f 5c 66 49 79 79 5c 66 52 3f 22 20 2c 0a  fB/\fIyy\fR?" ,.
a6b0: 2e 51 57 20 22 5c 66 49 6d 6f 6e 74 68 6e 61 6d  .QW "\fImonthnam
a6c0: 65 20 64 64 5c 66 52 3f 5c 66 42 2c 20 5c 66 49  e dd\fR?\fB, \fI
a6d0: 79 79 5c 66 52 3f 22 20 2c 0a 2e 51 57 20 22 5c  yy\fR?" ,..QW "\
a6e0: 66 49 64 61 79 5c 66 42 2c 20 5c 66 49 64 64 20  fIday\fB, \fIdd 
a6f0: 6d 6f 6e 74 68 6e 61 6d 65 20 5c 66 52 3f 5c 66  monthname \fR?\f
a700: 49 79 79 5c 66 52 3f 22 20 2c 0a 2e 51 57 20 22  Iyy\fR?" ,..QW "
a710: 5c 66 49 64 64 20 6d 6f 6e 74 68 6e 61 6d 65 20  \fIdd monthname 
a720: 79 79 5c 66 52 22 20 2c 0a 2e 51 57 20 22 3f 5c  yy\fR" ,..QW "?\
a730: 66 49 43 43 5c 66 52 3f 5c 66 49 79 79 6d 6d 64  fICC\fR?\fIyymmd
a740: 64 5c 66 52 22 20 2c 0a 61 6e 64 0a 2e 51 57 20  d\fR" ,.and..QW 
a750: 22 5c 66 49 64 64 5c 66 42 5c 2d 5c 66 49 6d 6f  "\fIdd\fB\-\fImo
a760: 6e 74 68 6e 61 6d 65 5c 66 42 5c 2d 5c 66 52 3f  nthname\fB\-\fR?
a770: 5c 66 49 43 43 5c 66 52 3f 5c 66 49 79 79 5c 66  \fICC\fR?\fIyy\f
a780: 52 22 20 2e 0a 54 68 65 20 64 65 66 61 75 6c 74  R" ..The default
a790: 20 79 65 61 72 20 69 73 20 74 68 65 20 63 75 72   year is the cur
a7a0: 72 65 6e 74 20 79 65 61 72 2e 20 20 49 66 20 74  rent year.  If t
a7b0: 68 65 20 79 65 61 72 20 69 73 20 6c 65 73 73 0a  he year is less.
a7c0: 74 68 61 6e 20 31 30 30 2c 20 77 65 20 74 72 65  than 100, we tre
a7d0: 61 74 20 74 68 65 20 79 65 61 72 73 20 30 30 2d  at the years 00-
a7e0: 36 38 20 61 73 20 32 30 30 30 2d 32 30 36 38 20  68 as 2000-2068 
a7f0: 61 6e 64 20 74 68 65 20 79 65 61 72 73 20 36 39  and the years 69
a800: 2d 39 39 0a 61 73 20 31 39 36 39 2d 31 39 39 39  -99.as 1969-1999
a810: 2e 20 20 4e 6f 74 20 61 6c 6c 20 70 6c 61 74 66  .  Not all platf
a820: 6f 72 6d 73 20 63 61 6e 20 72 65 70 72 65 73 65  orms can represe
a830: 6e 74 20 74 68 65 20 79 65 61 72 73 20 33 38 2d  nt the years 38-
a840: 37 30 2c 20 73 6f 0a 61 6e 20 65 72 72 6f 72 20  70, so.an error 
a850: 6d 61 79 20 72 65 73 75 6c 74 20 69 66 20 74 68  may result if th
a860: 65 73 65 20 79 65 61 72 73 20 61 72 65 20 75 73  ese years are us
a870: 65 64 2e 0a 2e 54 50 0a 5c 66 49 49 53 4f 20 38  ed...TP.\fIISO 8
a880: 36 30 31 20 70 6f 69 6e 74 2d 69 6e 2d 74 69 6d  601 point-in-tim
a890: 65 5c 66 52 0a 2e 0a 41 6e 20 49 53 4f 20 38 36  e\fR...An ISO 86
a8a0: 30 31 20 70 6f 69 6e 74 2d 69 6e 2d 74 69 6d 65  01 point-in-time
a8b0: 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 2c 20   specification, 
a8c0: 73 75 63 68 20 61 73 0a 2e 51 57 20 22 5c 66 49  such as..QW "\fI
a8d0: 43 43 79 79 6d 6d 64 64 5c 66 42 54 5c 66 49 68  CCyymmdd\fBT\fIh
a8e0: 68 6d 6d 73 73 5c 66 52 22 20 2c 0a 77 68 65 72  hmmss\fR" ,.wher
a8f0: 65 20 5c 66 42 54 5c 66 52 20 69 73 20 74 68 65  e \fBT\fR is the
a900: 20 6c 69 74 65 72 61 6c 0a 2e 51 57 20 54 20 2c   literal..QW T ,
a910: 0a 2e 51 57 20 22 5c 66 49 43 43 79 79 6d 6d 64  ..QW "\fICCyymmd
a920: 64 20 68 68 6d 6d 73 73 5c 66 52 22 20 2c 0a 2e  d hhmmss\fR" ,..
a930: 51 57 20 22 5c 66 49 43 43 79 79 6d 6d 64 64 5c  QW "\fICCyymmdd\
a940: 66 42 54 5c 66 49 68 68 3a 6d 6d 3a 73 73 5c 66  fBT\fIhh:mm:ss\f
a950: 52 22 20 2c 0a 6f 72 0a 2e 51 57 20 22 5c 66 49  R" ,.or..QW "\fI
a960: 43 43 79 79 2d 6d 6d 2d 64 64 5c 66 42 54 5c 66  CCyy-mm-dd\fBT\f
a970: 49 68 68 3a 6d 6d 3a 73 73 5c 66 52 22 20 2e 0a  Ihh:mm:ss\fR" ..
a980: 4e 6f 74 65 20 74 68 61 74 20 6f 6e 6c 79 20 74  Note that only t
a990: 68 65 73 65 20 66 6f 75 72 20 66 6f 72 6d 61 74  hese four format
a9a0: 73 20 61 72 65 20 61 63 63 65 70 74 65 64 2e 0a  s are accepted..
a9b0: 54 68 65 20 63 6f 6d 6d 61 6e 64 20 64 6f 65 73  The command does
a9c0: 20 5c 66 49 6e 6f 74 5c 66 52 20 61 63 63 65 70   \fInot\fR accep
a9d0: 74 20 74 68 65 20 66 75 6c 6c 20 72 61 6e 67 65  t the full range
a9e0: 20 6f 66 20 70 6f 69 6e 74 2d 69 6e 2d 74 69 6d   of point-in-tim
a9f0: 65 0a 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73  e.specifications
aa00: 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 49 53   specified in IS
aa10: 4f 38 36 30 31 2e 20 20 4f 74 68 65 72 20 66 6f  O8601.  Other fo
aa20: 72 6d 61 74 73 20 63 61 6e 20 62 65 20 72 65 63  rmats can be rec
aa30: 6f 67 6e 69 7a 65 64 20 62 79 0a 67 69 76 69 6e  ognized by.givin
aa40: 67 20 61 6e 20 65 78 70 6c 69 63 69 74 20 5c 66  g an explicit \f
aa50: 42 5c 2d 66 6f 72 6d 61 74 5c 66 52 20 6f 70 74  B\-format\fR opt
aa60: 69 6f 6e 20 74 6f 20 74 68 65 20 5c 66 42 63 6c  ion to the \fBcl
aa70: 6f 63 6b 20 73 63 61 6e 5c 66 52 20 63 6f 6d 6d  ock scan\fR comm
aa80: 61 6e 64 2e 0a 2e 54 50 0a 5c 66 49 72 65 6c 61  and...TP.\fIrela
aa90: 74 69 76 65 20 74 69 6d 65 5c 66 52 0a 2e 0a 41  tive time\fR...A
aaa0: 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 20 72   specification r
aab0: 65 6c 61 74 69 76 65 20 74 6f 20 74 68 65 20 63  elative to the c
aac0: 75 72 72 65 6e 74 20 74 69 6d 65 2e 20 20 54 68  urrent time.  Th
aad0: 65 20 66 6f 72 6d 61 74 20 69 73 20 5c 66 42 6e  e format is \fBn
aae0: 75 6d 62 65 72 0a 75 6e 69 74 5c 66 52 2e 20 41  umber.unit\fR. A
aaf0: 63 63 65 70 74 61 62 6c 65 20 75 6e 69 74 73 20  cceptable units 
ab00: 61 72 65 20 5c 66 42 79 65 61 72 5c 66 52 2c 20  are \fByear\fR, 
ab10: 5c 66 42 66 6f 72 74 6e 69 67 68 74 5c 66 52 2c  \fBfortnight\fR,
ab20: 0a 5c 66 42 6d 6f 6e 74 68 5c 66 52 2c 20 5c 66  .\fBmonth\fR, \f
ab30: 42 77 65 65 6b 5c 66 52 2c 20 5c 66 42 64 61 79  Bweek\fR, \fBday
ab40: 5c 66 52 2c 0a 5c 66 42 68 6f 75 72 5c 66 52 2c  \fR,.\fBhour\fR,
ab50: 20 5c 66 42 6d 69 6e 75 74 65 5c 66 52 20 28 6f   \fBminute\fR (o
ab60: 72 20 5c 66 42 6d 69 6e 5c 66 52 29 2c 20 61 6e  r \fBmin\fR), an
ab70: 64 20 5c 66 42 73 65 63 6f 6e 64 5c 66 52 20 28  d \fBsecond\fR (
ab80: 6f 72 20 5c 66 42 73 65 63 5c 66 52 29 2e 20 20  or \fBsec\fR).  
ab90: 54 68 65 0a 75 6e 69 74 20 63 61 6e 20 62 65 20  The.unit can be 
aba0: 73 70 65 63 69 66 69 65 64 20 61 73 20 61 20 73  specified as a s
abb0: 69 6e 67 75 6c 61 72 20 6f 72 20 70 6c 75 72 61  ingular or plura
abc0: 6c 2c 20 61 73 20 69 6e 20 5c 66 42 33 20 77 65  l, as in \fB3 we
abd0: 65 6b 73 5c 66 52 2e 0a 54 68 65 73 65 20 6d 6f  eks\fR..These mo
abe0: 64 69 66 69 65 72 73 20 6d 61 79 20 61 6c 73 6f  difiers may also
abf0: 20 62 65 20 73 70 65 63 69 66 69 65 64 3a 0a 5c   be specified:.\
ac00: 66 42 74 6f 6d 6f 72 72 6f 77 5c 66 52 2c 20 5c  fBtomorrow\fR, \
ac10: 66 42 79 65 73 74 65 72 64 61 79 5c 66 52 2c 20  fByesterday\fR, 
ac20: 5c 66 42 74 6f 64 61 79 5c 66 52 2c 20 5c 66 42  \fBtoday\fR, \fB
ac30: 6e 6f 77 5c 66 52 2c 0a 5c 66 42 6c 61 73 74 5c  now\fR,.\fBlast\
ac40: 66 52 2c 20 5c 66 42 74 68 69 73 5c 66 52 2c 20  fR, \fBthis\fR, 
ac50: 5c 66 42 6e 65 78 74 5c 66 52 2c 20 5c 66 42 61  \fBnext\fR, \fBa
ac60: 67 6f 5c 66 52 2e 0a 2e 50 50 0a 54 68 65 20 61  go\fR...PP.The a
ac70: 63 74 75 61 6c 20 64 61 74 65 20 69 73 20 63 61  ctual date is ca
ac80: 6c 63 75 6c 61 74 65 64 20 61 63 63 6f 72 64 69  lculated accordi
ac90: 6e 67 20 74 6f 20 74 68 65 20 66 6f 6c 6c 6f 77  ng to the follow
aca0: 69 6e 67 20 73 74 65 70 73 2e 0a 2e 50 50 0a 46  ing steps...PP.F
acb0: 69 72 73 74 2c 20 61 6e 79 20 61 62 73 6f 6c 75  irst, any absolu
acc0: 74 65 20 64 61 74 65 20 61 6e 64 2f 6f 72 20 74  te date and/or t
acd0: 69 6d 65 20 69 73 20 70 72 6f 63 65 73 73 65 64  ime is processed
ace0: 20 61 6e 64 20 63 6f 6e 76 65 72 74 65 64 2e 0a   and converted..
acf0: 55 73 69 6e 67 20 74 68 61 74 20 74 69 6d 65 20  Using that time 
ad00: 61 73 20 74 68 65 20 62 61 73 65 2c 20 64 61 79  as the base, day
ad10: 2d 6f 66 2d 77 65 65 6b 20 73 70 65 63 69 66 69  -of-week specifi
ad20: 63 61 74 69 6f 6e 73 20 61 72 65 20 61 64 64 65  cations are adde
ad30: 64 2e 0a 4e 65 78 74 2c 20 72 65 6c 61 74 69 76  d..Next, relativ
ad40: 65 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e 73  e specifications
ad50: 20 61 72 65 20 75 73 65 64 2e 20 20 49 66 20 61   are used.  If a
ad60: 20 64 61 74 65 20 6f 72 20 64 61 79 20 69 73 0a   date or day is.
ad70: 73 70 65 63 69 66 69 65 64 2c 20 61 6e 64 20 6e  specified, and n
ad80: 6f 20 61 62 73 6f 6c 75 74 65 20 6f 72 20 72 65  o absolute or re
ad90: 6c 61 74 69 76 65 20 74 69 6d 65 20 69 73 20 67  lative time is g
ada0: 69 76 65 6e 2c 20 6d 69 64 6e 69 67 68 74 20 69  iven, midnight i
adb0: 73 0a 75 73 65 64 2e 20 20 46 69 6e 61 6c 6c 79  s.used.  Finally
adc0: 2c 20 61 20 63 6f 72 72 65 63 74 69 6f 6e 20 69  , a correction i
add0: 73 20 61 70 70 6c 69 65 64 20 73 6f 20 74 68 61  s applied so tha
ade0: 74 20 74 68 65 20 63 6f 72 72 65 63 74 20 68 6f  t the correct ho
adf0: 75 72 20 6f 66 0a 74 68 65 20 64 61 79 20 69 73  ur of.the day is
ae00: 20 70 72 6f 64 75 63 65 64 20 61 66 74 65 72 20   produced after 
ae10: 61 6c 6c 6f 77 69 6e 67 20 66 6f 72 20 64 61 79  allowing for day
ae20: 6c 69 67 68 74 20 73 61 76 69 6e 67 73 20 74 69  light savings ti
ae30: 6d 65 0a 64 69 66 66 65 72 65 6e 63 65 73 20 61  me.differences a
ae40: 6e 64 20 74 68 65 20 63 6f 72 72 65 63 74 20 64  nd the correct d
ae50: 61 74 65 20 69 73 20 67 69 76 65 6e 20 77 68 65  ate is given whe
ae60: 6e 20 67 6f 69 6e 67 20 66 72 6f 6d 20 74 68 65  n going from the
ae70: 20 65 6e 64 0a 6f 66 20 61 20 6c 6f 6e 67 20 6d   end.of a long m
ae80: 6f 6e 74 68 20 74 6f 20 61 20 73 68 6f 72 74 20  onth to a short 
ae90: 6d 6f 6e 74 68 2e 0a 2e 50 50 0a 54 68 65 20 70  month...PP.The p
aea0: 72 65 63 65 64 65 6e 63 65 20 6f 66 20 74 68 65  recedence of the
aeb0: 20 61 70 70 6c 79 69 6e 67 20 6f 66 20 73 69 6e   applying of sin
aec0: 67 6c 65 20 74 6f 6b 65 6e 73 20 72 65 73 70 2e  gle tokens resp.
aed0: 20 77 68 69 63 68 20 73 65 71 75 65 6e 63 65 20   which sequence 
aee0: 77 69 6c 6c 20 62 65 0a 75 73 65 64 20 62 79 20  will be.used by 
aef0: 63 61 6c 63 75 6c 61 74 69 6e 67 20 6f 66 20 74  calculating of t
af00: 68 65 20 74 69 6d 65 20 69 73 20 63 6f 6d 70 6c  he time is compl
af10: 65 78 2c 20 65 2e 20 67 2e 20 68 65 61 76 69 6c  ex, e. g. heavil
af20: 79 20 64 65 70 65 6e 64 65 6e 74 20 6f 6e 20 74  y dependent on t
af30: 68 65 0a 70 72 65 63 69 73 69 6f 6e 20 6f 66 20  he.precision of 
af40: 74 79 70 65 20 6f 66 20 74 68 65 20 74 6f 6b 65  type of the toke
af50: 6e 2e 0a 2e 73 70 0a 49 6e 20 65 78 61 6d 70 6c  n...sp.In exampl
af60: 65 20 62 65 6c 6f 77 20 74 68 65 20 73 65 63 6f  e below the seco
af70: 6e 64 20 64 61 74 65 2d 73 74 72 69 6e 67 20 63  nd date-string c
af80: 6f 6e 74 61 69 6e 73 20 22 6e 65 78 74 20 4a 61  ontains "next Ja
af90: 6e 75 61 72 79 22 2c 20 74 68 65 72 65 66 6f 72  nuary", therefor
afa0: 65 0a 69 74 20 72 65 73 75 6c 74 73 20 69 6e 20  e.it results in 
afb0: 6e 65 78 74 20 79 65 61 72 20 62 75 74 20 69 6e  next year but in
afc0: 20 4a 61 6e 75 61 72 79 2e 20 41 6e 64 20 74 68   January. And th
afd0: 69 72 64 20 64 61 74 65 2d 73 74 72 69 6e 67 20  ird date-string 
afe0: 62 65 73 69 64 65 73 20 22 4a 61 6e 75 61 72 79  besides "January
aff0: 22 0a 63 6f 6e 74 61 69 6e 73 20 61 6c 73 6f 20  ".contains also 
b000: 61 64 64 69 74 69 6f 6e 61 6c 6c 79 20 22 46 72  additionally "Fr
b010: 69 22 2c 20 73 6f 20 69 74 20 72 65 73 75 6c 74  i", so it result
b020: 73 20 69 6e 20 74 68 65 20 6e 65 61 72 65 73 74  s in the nearest
b030: 20 46 72 69 64 61 79 2e 0a 54 68 75 73 20 62 6f   Friday..Thus bo
b040: 74 68 20 77 69 6e 20 62 65 66 6f 72 65 20 22 33  th win before "3
b050: 38 35 20 64 61 79 73 22 20 72 65 73 70 2e 20 6d  85 days" resp. m
b060: 61 6b 65 20 69 74 20 6d 6f 72 65 20 70 72 65 63  ake it more prec
b070: 69 73 65 2c 20 62 65 63 61 75 73 65 20 6f 66 20  ise, because of 
b080: 68 69 67 68 65 72 0a 70 72 65 63 69 73 69 6f 6e  higher.precision
b090: 20 6f 66 20 74 68 69 73 20 74 6f 6b 65 6e 20 74   of this token t
b0a0: 79 70 65 73 2e 0a 2e 43 53 0a 25 20 63 6c 6f 63  ypes...CS.% cloc
b0b0: 6b 20 66 6f 72 6d 61 74 20 5b 63 6c 6f 63 6b 20  k format [clock 
b0c0: 73 63 61 6e 20 22 35 20 79 65 61 72 73 20 31 38  scan "5 years 18
b0d0: 20 6d 6f 6e 74 68 73 20 33 38 35 20 64 61 79 73   months 385 days
b0e0: 22 20 2d 62 61 73 65 20 30 20 2d 67 6d 74 20 31  " -base 0 -gmt 1
b0f0: 5d 20 2d 67 6d 74 20 31 0a 54 68 75 20 4a 75 6c  ] -gmt 1.Thu Jul
b100: 20 32 31 20 30 30 3a 30 30 3a 30 30 20 47 4d 54   21 00:00:00 GMT
b110: 20 31 39 37 37 0a 25 20 63 6c 6f 63 6b 20 66 6f   1977.% clock fo
b120: 72 6d 61 74 20 5b 63 6c 6f 63 6b 20 73 63 61 6e  rmat [clock scan
b130: 20 22 35 20 79 65 61 72 73 20 31 38 20 6d 6f 6e   "5 years 18 mon
b140: 74 68 73 20 33 38 35 20 64 61 79 73 20 6e 65 78  ths 385 days nex
b150: 74 20 4a 61 6e 75 61 72 79 22 20 2d 62 61 73 65  t January" -base
b160: 20 30 20 2d 67 6d 74 20 31 5d 20 2d 67 6d 74 20   0 -gmt 1] -gmt 
b170: 31 0a 53 61 74 20 4a 61 6e 20 32 31 20 30 30 3a  1.Sat Jan 21 00:
b180: 30 30 3a 30 30 20 47 4d 54 20 31 39 37 38 0a 25  00:00 GMT 1978.%
b190: 20 63 6c 6f 63 6b 20 66 6f 72 6d 61 74 20 5b 63   clock format [c
b1a0: 6c 6f 63 6b 20 73 63 61 6e 20 22 35 20 79 65 61  lock scan "5 yea
b1b0: 72 73 20 31 38 20 6d 6f 6e 74 68 73 20 33 38 35  rs 18 months 385
b1c0: 20 64 61 79 73 20 6e 65 78 74 20 4a 61 6e 75 61   days next Janua
b1d0: 72 79 20 46 72 69 22 20 2d 62 61 73 65 20 30 20  ry Fri" -base 0 
b1e0: 2d 67 6d 74 20 31 5d 20 2d 67 6d 74 20 31 0a 46  -gmt 1] -gmt 1.F
b1f0: 72 69 20 4a 61 6e 20 32 37 20 30 30 3a 30 30 3a  ri Jan 27 00:00:
b200: 30 30 20 47 4d 54 20 31 39 37 38 0a 2e 43 45 0a  00 GMT 1978..CE.
b210: 2e 53 48 20 22 53 45 45 20 41 4c 53 4f 22 0a 6d  .SH "SEE ALSO".m
b220: 73 67 63 61 74 28 6e 29 0a 2e 53 48 20 4b 45 59  sgcat(n)..SH KEY
b230: 57 4f 52 44 53 0a 63 6c 6f 63 6b 2c 20 64 61 74  WORDS.clock, dat
b240: 65 2c 20 74 69 6d 65 0a 2e 53 48 20 22 43 4f 50  e, time..SH "COP
b250: 59 52 49 47 48 54 22 0a 43 6f 70 79 72 69 67 68  YRIGHT".Copyrigh
b260: 74 20 5c 28 63 6f 20 32 30 30 34 20 4b 65 76 69  t \(co 2004 Kevi
b270: 6e 20 42 2e 20 4b 65 6e 6e 79 20 3c 6b 65 6e 6e  n B. Kenny <kenn
b280: 79 6b 62 40 61 63 6d 2e 6f 72 67 3e 2e 20 41 6c  [email protected]>. Al
b290: 6c 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65  l rights reserve
b2a0: 64 2e 0a 27 5c 22 20 4c 6f 63 61 6c 20 56 61 72  d..'\" Local Var
b2b0: 69 61 62 6c 65 73 3a 0a 27 5c 22 20 6d 6f 64 65  iables:.'\" mode
b2c0: 3a 20 6e 72 6f 66 66 0a 27 5c 22 20 45 6e 64 3a  : nroff.'\" End:
b2d0: 0a                                               .