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 pop push shift unshift實(shí)例介紹
perl的pop跟push操作數(shù)組的最右邊,shift跟unshift操作數(shù)組的最左邊2013-02-02perl 標(biāo)量和運(yùn)算符的一些知識(shí)介紹
有關(guān)perl的標(biāo)量和運(yùn)算符的一些知識(shí),有需要的朋友可以看看2013-02-02perl 讀取所需文件的路徑,然后打開(kāi)相應(yīng)的文件
perl,讀取所需文件的路徑,然后打開(kāi)相應(yīng)的文件,并對(duì)文件中的DNA序列進(jìn)行計(jì)數(shù),substr函數(shù)對(duì)長(zhǎng)字符串的片段化處理功能2013-03-03