• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Matrix
            Klarke's C/C++ Home
            posts - 61,comments - 0,trackbacks - 0

            Here are a few examples. Also see the documentation for the `-d' option in the previous section.

            • To print the date of the day before yesterday:
              date --date='2 days ago'
              
            • To print the date of the day three months and one day hence:
              date --date='3 months 1 day'
              
            • To print the day of year of Christmas in the current year:
              date --date='25 Dec' +%j
              
            • To print the current full month name and the day of the month:
              date '+%B %d'
              
              But this may not be what you want because for the first nine days of the month, the `%d' expands to a zero-padded two-digit field, for example `date -d 1may '+%B %d'' will print `May 01'.
            • To print a date without the leading zero for one-digit days of the month, you can use the (GNU extension) - modifier to suppress the padding altogether.
              date -d=1may '+%B %-d'
              
            • To print the current date and time in the format required by many non-GNU versions of date when setting the system clock:
              date +%m%d%H%M%Y.%S
              
            • To set the system clock forward by two minutes:
              date --set='+2 minutes'
              
            • To print the date in the format specified by RFC-822, use `date --rfc'. I just did and saw this:
              Mon, 25 Mar 1996 23:34:17 -0600
              
            • To convert a date string to the number of seconds since the epoch (which is 1970-01-01 00:00:00 UTC), use the `--date' option with the `%s' format. That can be useful in sorting and/or graphing and/or comparing data by date. The following command outputs the number of the seconds since the epoch for the time one second later than the epoch, but in time zone five hours later (Cambridge, Massachusetts), thus a total of five hours and one second after the epoch:
              date --date='1970-01-01 00:00:01 UTC +5 hours' +%s
              18001
              
              Suppose you had not specified time zone information in the example above. Then, date would have used your computer's idea of the time zone when interpreting the string. Here's what you would get if you were in Greenwich, England:
              # local time zone used
              date --date='1970-01-01 00:00:01' +%s
              1
              
            • If you're sorting or graphing dated data, your raw date values may be represented as seconds since the epoch. But few people can look at the date `946684800' and casually note "Oh, that's the first second of the year 2000."
              date --date='2000-01-01 UTC' +%s
              946684800
              
              To convert such an unwieldy number of seconds back to a more readable form, use a command like this:
              date -d '1970-01-01 946684800 sec' +"%Y-%m-%d %T %z"
              2000-01-01 00:00:00 +0000
              
            posted on 2011-08-05 15:59 Klarke 閱讀(862) 評(píng)論(0)  編輯 收藏 引用

            只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            久久久久亚洲av综合波多野结衣| 久久精品毛片免费观看| 国产午夜精品久久久久九九电影| 久久精品18| 久久精品国产亚洲AV高清热| 狠狠人妻久久久久久综合蜜桃| 亚洲人成无码网站久久99热国产| 久久久久高潮毛片免费全部播放 | 青青草原综合久久大伊人导航| 怡红院日本一道日本久久| 久久久久久久久久久免费精品| 人人狠狠综合久久88成人| 久久AⅤ人妻少妇嫩草影院| 亚洲中文字幕无码一久久区| 久久久久国产视频电影| 国产成人久久精品一区二区三区 | 国产精品久久久久影视不卡| 久久综合精品国产一区二区三区 | 久久久久波多野结衣高潮| 日本精品久久久久中文字幕8 | 久久发布国产伦子伦精品| 亚洲精品美女久久久久99小说| 97精品国产97久久久久久免费| 久久精品日日躁夜夜躁欧美| 久久天天躁狠狠躁夜夜av浪潮| 久久精品九九亚洲精品天堂 | 影音先锋女人AV鲁色资源网久久| 国产成人精品久久综合| 久久99国产精品久久99| 久久亚洲精品中文字幕| 亚洲精品无码专区久久久| 久久久久久国产a免费观看黄色大片 | 国内精品伊人久久久影院| 久久这里有精品视频| 免费一级欧美大片久久网| 久久亚洲av无码精品浪潮| 理论片午午伦夜理片久久| 性做久久久久久免费观看| 一本大道久久东京热无码AV| 久久夜色精品国产亚洲| 久久精品无码午夜福利理论片|