ปลั๊กอินสำหรับไพธอนวินาทีที่จะ datetime

รหัสตัวอย่าง

1
0

N

import datetime
dt = datetime.datetime.today()
print dt.year
# Output: 2016

print dt.month
# Output: 8

print dt.day
# Output: 22
1
0

N

time = 72.345

hours = int(time)
minutes = (time*60) % 60
seconds = (time*3600) % 60

print("%d:%02d.%02d" % (hours, minutes, seconds))
>> 72:20:42
0
0

N

seconds_input = 43290
conversion = datetime.timedelta(seconds=seconds_input)
print(str(converted_time))

#output 12:01:30
0
0

N

str(int(math.floor(time))) + ':' + str(int((time%(math.floor(time)))*60)) + ':' + str(int(((time%(math.floor(time)))*60) % math.floor(((time%(math.floor(time)))*60))*60))
0
0

N

from datetime import datetime
dt = datetime.today()  # Get timezone naive now
seconds = dt.timestamp()
0
0

N

import datetime
datetime.datetime.timestamp(datetime.timedelta(hours=1, days=2, seconds=1000)).total_seconds()

หน้าคล้ายกัน

คล้ายกันหน้ากับตัวอย่าง

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังหน้ากับตัวอย่างอยู่ในหมวดหมู่