clock

clock(3tcl)                  Tcl Built-In Commands                 clock(3tcl)



______________________________________________________________________________

NAME
       clock - è·ååæ纵æ¶é´

æ»è§ SYNOPSIS
       clock option ?arg arg ...?
_________________________________________________________________


æè¿° DESCRIPTION
       è¿ä¸ªå½ä»¤è¿è¡å¤ç§æä½ä¸‐
       çæä¸ä¸ªï¼å¯ä»¥è·åææ纵表示ä¸äºæ¶é´æ¦å¿µ(notion)çå符串æå¼ãoption
       åæ°ç¡®å®è¿ä¸ªå½ä»¤å®æä»ä¹æä½ãåæ³ç options  (å¯ä»¥ä½¿ç¨ç¼©å) æ:

       clock clicks ?-milliseconds?                                            │
              è¿åä¸ä¸ªé«è§£æ度(high-                                          │
              resolution)çæ¶é´å¼ï¼æ¯ä¸ä¸ªä¾èµäºç³»ç»çæ´æ°ãå¼çåä½æ¯ä¾èµäºç³»ç»çä½åºè¯¥æ¯ç³»ç»ä¸å¯è·å¾çæé«è§£æ度çæ¶éï¼æ¯å¦ä¸ä¸ª│
              CPU å¨æè®°æ°(counter)ãå¦ææå®äº -milliseconds                     │
              ï¼åä¿è¯è¿ä¸ªå¼æ¯å¾®ç§çç²åº¦ãè¿ä¸ªå¼åªåºç¨äºæµéäºçæ¶é´çç¸å¯¹æµéã

       clock format clockValue ?-format string? ?-gmt boolean?
              æä¸ä¸ªæ´æ°æ¶é´å¼è½¬æ¢æ人å¯é读çå½¢å¼ï¼å¸åçï¼è¿ä¸ªæ¶é´å¼æ¯ä»
              clock secondsãclock scanãæ file å½ä»¤ç atimeã mtimeãæ ctime
              é项è¿åçãå¦æ -format  åæ°å‐
              å¨ï¼ä¸ä¸ä¸ªåæ°æ¯æè¿°å¦ä½æ ¼å¼åæ¥æåæ¶é´çä¸ä¸ªå符串ãå‐
              段æ述符ç±ä¸ä¸ª % åéåçå段æ述符å符ç»æãææçå¶ä»å‐
              符é½å¤å¶å°ç»æä¸ãææçå段æ述符æ:

              %%     æå¥ä¸ä¸ª %ã

              %a     ææåç缩å (Mon, Tue, etc.)ã

              %A     å®æ´çææå (Monday, Tuesday, etc.)ã

              %b     æåç缩å (Jan, Feb, etc.)ã

              %B     å®æ´çæåã

              %c     ç¹å®äºæ¬å°çæ¥æåæ¶é´ã

              %d     æä¸ç第å 天 (01 - 31)ã

              %H     24å°æ¶æ ¼å¼çå°æ¶(00 - 23)ã

              %I     12å°æ¶æ ¼å¼çå°æ¶ (00 - 12)ã

              %j     å¹´ä¸ç第å 天 (001 - 366)ã

              %m     第å æ (01 - 12)ã

              %M     å (00 - 59)ã

              %p     AM/PM æ示符ã

              %S     ç§ (00 - 59)ã

              %U     å¹´ä¸ç第å ææ (00 - 52)ï¼ææ天æ¯ä¸ä¸ªææä¸ç第ä¸å¤©ã

              %w     ææå  (Sunday = 0)ã

              %W     å¹´ä¸ç第å ææ (00 - 52)ï¼ææä¸æ¯ä¸ä¸ªææä¸ç第ä¸å¤©ã

              %x     ç¹å®äºæ¬å°çæ¥ææ ¼å¼ã

              %X     ç¹å®äºæ¬å°çæ¶é´æ ¼å¼ã

              %y     ä¸çºªä¸ç第å å¹´ (00 - 99)ã

              %Y     带ä¸çºªçå¹´ (ä¾å¦ 1990)ã

              %Z     æ¶åºåã

              å¨ä¸äºç³»ç»ä¸æ¯æä¸åè¡¥åçå段æ述符(ä¾å¦å¨ Unix ä¸èä¸å¨
              Windows):

              %D     å½¢å¦ %m/%d/%y çæ¥æã

              %e     æä¸ç第å 天 (1 - 31)ï¼æ²¡æå导çé¶ã

              %h     æåç缩åã

              %n     æå¥ä¸ä¸ªæ¢è¡ã

              %r     å½¢å¦ %I:%M:%S %p çæ¶é´ã

              %R     å½¢å¦ %H:%M çæ¶é´ã

              %t     æå¥ä¸ä¸ª tabã

              %T     å½¢å¦ %H:%M:%S çæ¶é´ã

              å¦ææªæå® -format  åæ°ï¼ä½¿ç¨æ ¼å¼ä¸² â%a %b %d %H:%M:%S %Z
              %Yâãå¦æ -gmt åæ°åå¨ï¼ä¸ä¸ä¸ªåæ°å¿é¡»æ¯ä¸ä¸ª boolean
              (å¼)ãå¦ææ¯çåæå®æ¶é´ä½ä¸º Greenwich
              æ åæ¶æ¥æ ¼å¼åï¼å¦ææ¯åå使ç¨æä½ç¯å¢å®ä¹çæ¬å°æ¶åºã

       clock scan dateString ?-base clockVal? ?-gmt boolean?
              æ dateString  转æ¢æä¸ä¸ªæ´æ°æ¶éå¼(åè§ clock
              seconds)ãè¿ä¸ªå½ä»¤å¯åæ并转æ¢å ä¹ææçæ åçæ¥æå/ææ¶é´ä¸²ï¼å¶ä¸‐
              å¯ä»¥åå«æ åçæ¶åºå©è®°ç (mnemonic)ãå¦æåªæå®äºä¸ä¸ªæ¶é´ï¼åå®ä¸ºå½åçæ¥æãå¦æ串ä¸‐
              ä¸åæ¬ä¸ä¸ªæ¶åºå©è®°ç ï¼é¤é -gmt åæ°æ¯çä¹å¤åå®ä¸ºæ¬å°æ¶åºï¼å¨
              -gmt  åæ°æ¯ççæåµä¸ï¼åå®æå®çæ¶é´æ¯ç¸å¯¹äº Greenwich
              æ åæ¶æ¥è®¡ç®æ¶éå¼ãå¦ææå®äº
              -gmtï¼å®åªå½±å计ç®åºçæ¶é´å¼ï¼ä¸å½±å对 -base ç解éã

              å¦ææå®äº -base
              æ è®°ï¼ä¸ä¸ä¸ªåæ°å°åæ¬ä¸ä¸ªæ´æ°çæ¶éå¼ãåªä½¿ç¨è¿ä¸ªå¼ä¸‐
              çæ¥æèä¸ç®¡æ¶é´ãè¿å¯¹ç¡®å®ç¹å®çæ天çæ¶é´æåå¶ä»çç¸å¯¹äºæ¥æç转æ¢æç¨ã

              dateString åå«é¶ä¸ªæå¤ä¸ªä¸åå½¢å¼çæå®(specification):

              time   ä¸å¤©ä¸çæ¶é´ï¼æ ·å¼æ¯: hh?:mm?:ss??  ?meridian? ?zone? or
                     hhmm ?meridian?  ?zone?. å¦æ为æå®ä¸ä¸å(meridian), hh
                     被解é为ä¸ä¸ª24å°æ¶éç¹ã

              date   ä¸ä¸ªç¹å®çæåæ¥ï¼å¹´æ¯å¯éçãå¯æ¥åçæ ¼å¼æ¯ mm/dd?/yy?,
                     monthname dd ?, yy?, dd monthname ?yy?, day, dd monthname
                     yy, ?CC?yymmdd, ?CC?yy-mm-dd, dd-monthname-?CC?yy.
                     缺ççå¹´æ¯å½åå¹´ãå¦æå¹´å°äº 100ï¼æ们æ 00-68 å¹´ä½ä¸º     │
                     2000-2068 å¹´è 69-99 å¹´ä½ä¸º 1969-1999                   │
                     å¹´ã注æææå¹³å°é½å¯ä»¥è¡¨ç¤º 38-70 å¹´,                   │
                     æ以å¦æ使ç¨è¿äºå¹´å°±å¯è½åºéã

              ISO 8601 point-in-time
                     ä¸ä¸ª ISO 8601 point-in-time æå®ï¼å¦ CCyymmddThhmmss, è¿é
                     T æ¯åé¢ç Tï¼CCyymmdd hhmmss, æè CCyymmddThh:mm:ss.

              relative time
                     ç¸å¯¹å½åæ¶é´çä¸ä¸ªæå®ãæ ¼å¼æ¯ number unitï¼å¯æ¥åçåä½æ¯
                     yearã fortnightã monthã weekã dayãhourã minute  min)ãå
                     second  sec)ãåä½å¯ä»¥è¢«æå®ä¸ºåæ°æå¤æ°ï¼æ¯å¦ 3
                     weeksãè¿å¯ä»¥æå®è¿äºä¿®é¥°ç¬¦: tomorrowã yesterdayãtodayã
                     nowãlastãthisã nextãagoã

              å®éçæ¥æ计ç®ä¾ç§ä¸åçæ‐
              ¥éª¤ãé¦åï¼å¤çå转æ¢ææç»å¯¹æ¥æå/ææ¶é´ã使ç¨è¿ä¸ªæ¶é´ä½ä¸ºåºå(base),æ·»å ä¸ææå (day-of-week)æå®ãå¶æ¬¡ï¼ä½¿ç¨ç¸å¯¹æå®ãå¦ææå®äºä¸ä¸ªæ¥æææ天ï¼å¹¶ä¸æ²¡æç»åºç»å¯¹æç¸å¯¹çæ¶é´ï¼å使ç¨åå¤ãæåï¼è¿è¡ä¸æ¬¡æ ¡æ‐
              £ï¼è¿æ ·å°±å¨ä¼°è®¡äºå¤ä»¤æ¶ä¸åä¹å产çæ£ç¡®çä¸å¤©ä¸‐
              çå°æ¶ï¼å¹¶ä¸å¨ä»ä¸ä¸ªå¤§æç»æå°ä¸ä¸ªå°ææ¶ç»åºæ£ç¡®çæ¥æã

              åªå¨ç¨å¦ä¸åä½æå®ç¸å¯¹æ¶é´çæ¶åè¿è¡å¤ä»¤æ¶æ ¡æ£ï¼æ¥ææ´å¤ï¼ä¾å¦
              daysã weeksã fortnightsãmonths æ
              yearsãè¿æå³çè·¨è¶å¤ä»¤æ¶è¾¹ççæ¶åï¼å¯¹ clock scan â1 dayâ å clock
              scan â24 hoursâ å°ç»åºä¸åçç»æ:
                     % clock scan "1 day" -base [clock scan 1999-10-31]
                     941443200
                     % clock scan "24 hours" -base [clock scan 1999-10-31]
                     941439600

       clock seconds
              æå½åçæ¥æåæ¶é´ä½ä¸ºä¾èµäºç³»ç»çæ´æ°å¼è¿åãå¼çåä½æ¯ç§ï¼å许å®è¢«ç¨äºç¸å¯¹æ¶é´ç计ç®ãå¼é常被å®ä¹æä»âepochâå¼å§(è³ä»)æ»å±æµéçæ¶é´ãä½ ä¸åºè¯¥åå®
              epoch çå¼ã


å³é®å KEYWORDS
       clock, date, time

[ä¸æçç»´æ¤äºº]
       å¯èé士

[ä¸æçææ°æ´æ°]
       2001/06/21

ãä¸å½ Linux 论å man æå页翻è¯è®¡åã:
       http://cmpp.linuxforum.net

è·
       æ¬é¡µé¢ä¸æçç±ä¸æ man æå页计åæä¾ã
       ä¸æ man æå页计åï¼https://github.com/man-pages-zh/manpages-zh



Tcl                                   8.3                          clock(3tcl)