Skip to content

Commit a34264c

Browse files
committed
update datetime.py
1 parent e25078d commit a34264c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

datatime.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#coding=utf-8
2+
from datetime import datetime
3+
4+
now=datetime.now()
5+
current_year=now.year
6+
current_month= now.month
7+
current_day=now.day
8+
current_hour=now.hour
9+
current_minutes=now.minute
10+
current_second=now.second
11+
current_date="今天是" + str(current_year) + "年" + str(current_month) +"月" +str(current_day) + "日"
12+
current_time="现在时间:"+str(current_hour)+"点"+str(current_minutes)+"分"+str(current_second)+"秒"
13+
14+
print current_date
15+
print current_time
16+

0 commit comments

Comments
 (0)