|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
|||||||||||||||||||||||||||||||||||||||||||||
2010年08月03日(火) 旧暦 [n年日記] [更新:"2010/08/04 17:08:28"]#1 [BSD] a date before the EPOCH
My machine is in Japan.
modena@makoto 07:17:50/100804(/export/pkgsrc)% ls -l /etc/localtime lrwxr-xr-x 1 root wheel 25 Apr 6 12:51 /etc/localtime -> /usr/share/zoneinfo/Japan modena@makoto 07:17:27/100804(~)% date -j -d '1970/01/01 08:59' '+%s' date: Cannot parse `1970/01/01 08:59' modena@makoto 07:17:30/100804(~)% date -j -d '1970/01/01 09:00' '+%s' 0This (argument to the 'date command') can not be used to get serial date of the birthday before 1970/01/01. Even 64 bit date ? SQL seems to have datediff function. mysql> SELECT DATEDIFF( STR_TO_DATE('08-04-2010','%d-%m-%Y'), STR_TO_DATE('10-12-1960','%d-%m-%Y')); +-----------------------------------------------------------+ | DATEDIFF( STR_TO_DATE('08-04-2010','%d-%m-%Y'), STR_TO_DATE('10-12-1960','%d-%m-%Y')) | +-----------------------------------------------------------+ | 18016 | +-----------------------------------------------------------+ 1 row in set (0.00 sec)It is dd-mm-yyyy, European Style for here. Converting a date string which is before 1970 into a timestamp in MySQL. ( つっこみ )
|
最近の日記 2025年01月15日 ・今更 advent calendar 2025年01月12日 ・金柑収穫 2025年01月07日 ・sh: 1: not found ・sh: 1: not found 2025年01月02日 ・geography/R-s2 | ||