dateã³ãã³ãã£ã¦ã·ã§ã«ã¹ã¯ãªããä½ãã¨ãã«ã¯ã¨ã¦ã便å©ã§ãããã
gnu ã®dateã³ãã³ãã¯ãã使ãä¾ããã£ã±ãä½ã£ã¦ããã¨ä¾¿å©ã§ãã
dateã³ãã³ãã®åºæ¬çãªä½¿ãæ¹
ãã¡ã¤ã«åãªã©ã§ãã使ãå½¢å¼
takuya@air:~$ date -I 2012-05-31
ããããã使ãããtar cvzf `date -l `.tgz ã¨ãããããã使ã
ããã¯æ¬¡ã¨åã
takuya@air:~$ date +"%Y-%m-%d" 2012-06-07
æ¥ä»ã¨æé
takuya@air:~$ date +"%Y-%m-%d#%H:%M:%S" 2012-07-13#21:59:33
UTCã§è¡¨ç¤ºã
takuya@air:~$ date -u æ°´ 5 30 18:21:14 UTC 2012
RFCå½¢å¼ï¼HTTPããããªã©ã§ç¨ããããå½¢å¼ï¼ã§è¡¨ç¤ºã
takuya@air:~$ date -R Thu, 31 May 2012 03:22:02 +0900
çµã¿åããã¦ä½¿ãã
æååãæ¥ä»ã«å¤æ
-d ãªãã·ã§ã³ã§æååãæ¥ä»ã«å¤æã
æ¨æ¥ã®æ¥ä»
takuya@air:~$ date -d âyesterdayâ æ°´ 5 30 03:25:01 JST 2012
ä»æ¥ã®æ¥ä»
takuya@air:~$ date -d "today" æ¨ 5 31 03:25:32 JST 2012
ï½æ¥ã¾ãã®æ¥ä»
takuya@air:~$ date -d "-3days" æ 5 28 03:25:28 JST 2012
ææ¥
takuya@air:~$ date -d "tomorrow" é 6 1 03:25:55 JST 2012
ï¼æ¥å¾ï¼ï½æ¥å¾ï¼
takuya@air:~$ date -d "+3days" æ¥ 6 3 03:26:06 JST 2012
æ¥æã®ä»æ¥
takuya@air:~$ date -d "next month" æ¥ 7 1 03:26:13 JST 2012
å æã®ä»æ¥
takuya@air:~$ date -d "last month" ç« 5 1 03:26:18 JST 2012
å é±
takuya@air:~$ date -d "last week" æ¨ 5 24 03:26:22 JST 2012
ããã使ã£ã¦ææ«ã®æ¥ä»ãæ±ããã®ã¯ãåºæ¬ã ãã
takuya@air:~/ncurses-5.9$ date -d 'now - 1 monthâ ç« 5 1 04:06:11 JST 2012
çµã¿åãã¦ä½¿ããæ¨æ¥ã®æ¥ä»ããã©ã¼ããã
takuya@air:~$ date -d "yesterday" +"%Y-%m-%d" 2012-06-06
ã¡ãªã¿ã«ç§ã使ã£ã¦ãã dateã³ãã³ãã¯GNUã®coreutilsã«ããã¾ãã
macã ã¨æ¨æºãããªãã®ã§æ³¨æ.
MacOSXã§ã®ã¤ã³ã¹ãã¼ã«
brew install coreutils export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
ããã«ãã£ã¨è©³ããæ¥ä»ã«ã¤ãã¦ã®è©³ããè¨è¿°ã¯ã³ã³ã«ããã