7.6 Relative item in date strings
Relative items adjust a date (or the current date if none) forward or backward. The effects of relative items accumulate. Here are some examples:
1 year
1 year ago
3 years
2 days
The unit of time displacement may be selected by the string `year' or `month' for moving by whole years or months. These are fuzzy units, as years and months are not all of equal duration. More precise units are `fortnight' which is worth 14 days, `week' worth 7 days, `day' worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60 seconds, and `second' or `sec' worth one second. An `s' suffix on these units is accepted and ignored.
The unit of time may be preceded by a multiplier, given as an optionally signed number. Unsigned numbers are taken as positively signed. No number at all implies 1 for a multiplier. Following a relative item by the string `ago' is equivalent to preceding the unit by a multiplier with value -1.
The string `tomorrow' is worth one day in the future (equivalent to `day'), the string `yesterday' is worth one day in the past (equivalent to `day ago').
The strings `now' or `today' are relative items corresponding to zero-valued time displacement, these strings come from the fact a zero-valued time displacement represents the current time when not otherwise change by previous items. They may be used to stress other items, like in `12:00 today'. The string `this' also has the meaning of a zero-valued time displacement, but is preferred in date strings like `this thursday'.
[링크 : http://sunsite.ualberta.ca/Documentation/Gnu/tar-1.13/html_chapter/tar_7.html#SEC111]
[링크 : http://www.linuxforums.org/forum/linux-programming-scripting/111764-yesterdays-date-linux.html]
Relative items adjust a date (or the current date if none) forward or backward. The effects of relative items accumulate. Here are some examples:
1 year
1 year ago
3 years
2 days
The unit of time displacement may be selected by the string `year' or `month' for moving by whole years or months. These are fuzzy units, as years and months are not all of equal duration. More precise units are `fortnight' which is worth 14 days, `week' worth 7 days, `day' worth 24 hours, `hour' worth 60 minutes, `minute' or `min' worth 60 seconds, and `second' or `sec' worth one second. An `s' suffix on these units is accepted and ignored.
The unit of time may be preceded by a multiplier, given as an optionally signed number. Unsigned numbers are taken as positively signed. No number at all implies 1 for a multiplier. Following a relative item by the string `ago' is equivalent to preceding the unit by a multiplier with value -1.
The string `tomorrow' is worth one day in the future (equivalent to `day'), the string `yesterday' is worth one day in the past (equivalent to `day ago').
The strings `now' or `today' are relative items corresponding to zero-valued time displacement, these strings come from the fact a zero-valued time displacement represents the current time when not otherwise change by previous items. They may be used to stress other items, like in `12:00 today'. The string `this' also has the meaning of a zero-valued time displacement, but is preferred in date strings like `this thursday'.
[링크 : http://sunsite.ualberta.ca/Documentation/Gnu/tar-1.13/html_chapter/tar_7.html#SEC111]
date --date=now date --date=today # same thing date --date='3 seconds' date --date='3 seconds ago' date --date='4 hours' date --date='tomorrow' date --date='1 day' date --date='1 days' date --date='yesterday' date --date='1 day ago' date --date='1 days ago' date --date='1 week' date --date='1 fortnight' date --date='1 month' date --date='1 year' |
[링크 : http://www.linuxforums.org/forum/linux-programming-scripting/111764-yesterdays-date-linux.html]
'Linux' 카테고리의 다른 글
for문의 효과 - 코드사이즈 줄이기(리눅스) (0) | 2009.05.27 |
---|---|
bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory (0) | 2009.05.13 |
update-rc.d :: 부팅시 자동시작 하도록 하는 스크립트 자동화 유틸리티 (2) | 2009.05.07 |
Gedit에 ctags 확장기능 추가하기 - Plugins (0) | 2009.05.06 |
Gedit 옵션을 살펴보자! (0) | 2009.05.06 |