Chinaunix首页 | 论坛 | 博客
  • 博客访问: 510722
  • 博文数量: 65
  • 博客积分: 2925
  • 博客等级: 上尉
  • 技术积分: 1306
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-01 10:56
个人简介

2013

文章分类

全部博文(65)

分类: Python/Ruby

2011-09-29 18:32:13

1. 显示时间
  1. ($sec,$min,$hour,$day,$mon,$year,$weekday,$yeardate,$savinglightday) = (localtime(time));
  2.     $sec = ($sec < 10)? "0$sec":$sec;
  3.     $min = ($min < 10)? "0$min":$min;
  4.     $hour = ($hour < 10)? "0$hour":$hour;
  5.     $day = ($day < 10)? "0$day":$day;
  6.     $mon = ($mon < 9)? "0".($mon+1):($mon+1);
  7.     $year += 1900;
  8.     $today = "$day.$mon.$year|$hour:$min:$sec";
  9.     print $today;


阅读(1481) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~