perl获取日期与时间的实例代码
时间:2023-03-30 23:57:01
注意:localtime获取的年份是相对于1900的偏移,需要加上1900,而localtime获取的month范围是0-11,需要加1。
#!/usr/bin/perl
my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime();
$year += 1900;
$mon++;
my $date = "$year-$mon-$day";
print $date, "\n";
标签:perl,日期,时间
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
JSON.parse处理非标准Json数据出错的解决
2024-04-18 09:49:12
如何制作关联的下拉菜单?
2010-06-29 21:19:00
Python快速从注释生成文档的方法
2022-07-11 04:55:37
![](https://img.aspxhome.com/file/2023/2/78642_0s.png)
tensorflow如何批量读取图片
2023-10-25 03:50:25
![](https://img.aspxhome.com/file/2023/2/120962_0s.jpg)
Python爬虫获取页面所有URL链接过程详解
2022-01-31 10:48:46
Python列表对象中元素的删除操作方法
2023-11-12 01:09:22
![](https://img.aspxhome.com/file/2023/0/115080_0s.png)
asp如何让浏览器在https和http之间转化?
2010-05-13 16:37:00
js实现固定区域内的不重叠随机圆
2024-05-13 09:18:40
![](https://img.aspxhome.com/file/2023/4/125934_0s.jpg)
Python装饰器使用接口测试的步骤
2021-03-27 11:39:06
![](https://img.aspxhome.com/file/2023/9/118429_0s.jpg)
python机器学习基础线性回归与岭回归算法详解
2021-03-09 07:29:43
![](https://img.aspxhome.com/file/2023/6/131696_0s.png)
Tkinter组件Entry的具体使用
2023-03-21 00:41:40
![](https://img.aspxhome.com/file/2023/4/69624_0s.png)
Python astype(np.float)函数使用方法解析
2021-02-23 17:28:16
![](https://img.aspxhome.com/file/2023/5/83905_0s.png)
python语言线程标准库threading.local解读总结
2023-12-22 18:18:07
SQL Server实现将特定字符串拆分并进行插入操作的方法
2024-01-21 04:48:31
自学python求已知DNA模板的互补DNA序列
2022-07-05 13:24:56
![](https://img.aspxhome.com/file/2023/2/95402_0s.jpg)
python爬虫scrapy框架的梨视频案例解析
2023-01-16 08:22:19
![](https://img.aspxhome.com/file/2023/8/127838_0s.jpg)
Python如何实现SSH远程连接与文件传输
2023-06-12 12:34:02
Golang中goroutine和channel使用介绍深入分析
2023-07-07 16:51:48
Oracle数据库编写有效事务指导方针
2009-03-19 17:41:00
SQL Server2008 数据库误删除数据的恢复方法分享
2024-01-14 10:05:23
![](https://img.aspxhome.com/file/2023/3/129313_0s.png)