datetime Flashcards

1
Q

import datetime

a = datetime.date(2018,11,28)
print(a.day)

A

28

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

import datetime

a = datetime.date(2018,11,28)
print(a.month)

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

import datetime

a = datetime.date(2018,11,28)
print(a.year)

A

2018

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

from datetime import time

print(time(11,34,56))

A

11:34:56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

from datetime import time

a = time(11,34,56)
print(a.hour)

A

11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

from datetime import time

a = time(11,34,56)
print(a.minute)

A

34

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

from datetime import time

a = time(11,34,56)
print(a.second)

A

56

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

import datetime

x = datetime.datetime(2018, 6, 1)

print(x.strftime(“%A”))

A
#Day of the week
Friday
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

import datetime

x = datetime.datetime(2018, 6, 1)

print(x.strftime(“%Y”))

A

2018

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

import datetime

x = datetime.datetime(2018, 6, 1)

print(x.strftime(“%j”))

A
#The number of the year
152
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

import datetime

x = datetime.datetime(2018, 6, 1)

print(x.strftime(“%W”))

A
#Week of the year
22
How well did you know this?
1
Not at all
2
3
4
5
Perfectly