'datetime' module Flashcards

1
Q

var = datetime.module()

A

creates a datetime object

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

now.date()

A

return date in YYYY-MM-DD format

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

now.year

A

return year

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

now.month

A

return month

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

now.day

A

return day

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

now.minute

A

return minute

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

now.second

A

return second

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

now.time()

A

returns current time in HH:MM:SS.ms format

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

now.strftime(ā€œx y zā€)

A

format time

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

formatting dates with strftime()

A
#Formatting date display with "Shift Time"
# %a -> Mon
# %A -> Monday
# %d -> 10
# %b -> Jan
# %B -> January
# %m -> 01
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

formatting time with strftime()

A
#Formatting time with "Shift Time"
# %H -> hours
# %M -> minutes
# %S -> seconds
# %p -> AM or PM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

formatting year with strftime()

A
#Formatting year
# %y - 17
# %Y - 2017
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

timedelta(x)

A

calculate times in the past or future

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

calendar.month(x)

A

print a calendar for given year

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

calendar.weekday(x, y, z)

A

determine dates in the future

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

calendar.isleap(x)

A

is this a leap year or not