Perl localtime時(shí)間函數(shù)的應(yīng)用介紹
1. 一般使用:
@nowtime=localtime();
#($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
注意:
$mon+1,$year+1900;
$now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994"
2.如果要把時(shí)間保存在數(shù)據(jù)庫(kù)中,可以先將其保存為字符串,然后讀出時(shí)對(duì)字符串再處理。
@nowtime=localtime();
$nowstring=join(',',@nowtime);
將$nowstring保存;
讀?。?BR>@nowtime=split(',',$nowstring);
更多內(nèi)容請(qǐng)參考:http://perldoc.perl.org/functions/localtime.html
相關(guān)文章
perl數(shù)組的多數(shù)字下標(biāo)示例代碼
perl數(shù)組中正常的下標(biāo)運(yùn)算,想必大家都比較熟悉,這里不作說(shuō)明。本文想說(shuō)的是perl數(shù)組下標(biāo)的多數(shù)字取值,可以極大的方便數(shù)組的操作2013-02-02
perl特殊符號(hào)及默認(rèn)的內(nèi)部變量
perl特殊符號(hào)及默認(rèn)的內(nèi)部變量,有需要的朋友不妨參考下2013-02-02

