当前位置: 移动技术网 > IT编程>网页制作>Perl > Perl localtime时间函数的应用介绍

Perl localtime时间函数的应用介绍

2017年12月08日  | 移动技术网IT编程  | 我要评论
1. 一般使用: @nowtime=localtime();#($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)

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.如果要把时间保存在数据库中,可以先将其保存为字符串,然后读出时对字符串再处理。

@nowtime=localtime();
$nowstring=join(',',@nowtime);
将$nowstring保存;
读取:
@nowtime=split(',',$nowstring);

更多内容请参考:

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网