python method - strftime()

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

%%

A literal '%' character. %

%-d

Day of the month as a decimal number. (Platform specific) 30

%d

Day of the month as a zero-padded decimal number. 30

%-j

Day of the year as a decimal number. (Platform specific) 273

%j

Day of the year as a zero-padded decimal number. 273

%-I

Hour (12-hour clock) as a decimal number. (Platform specific) 7

%I

Hour (12-hour clock) as a zero-padded decimal number. 07

%-H

Hour (24-hour clock) as a decimal number. (Platform specific) 7

%H

Hour (24-hour clock) as a zero-padded decimal number. 07

%c

Locale's appropriate date and time representation. Mon Sep 30 07:06:05 2013

%x

Locale's appropriate date representation. 09/30/13

%X

Locale's appropriate time representation. 07:06:05

%p

Locale's equivalent of either AM or PM. AM

%f

Microsecond as a decimal number, zero-padded on the left. 000000

%-M

Minute as a decimal number. (Platform specific) 6

%M

Minute as a zero-padded decimal number. 06

%-m

Month as a decimal number. (Platform specific) 9

%m

Month as a zero-padded decimal number. 09

%b

Month as locale's abbreviated name. Sep

%B

Month as locale's full name. September

%-S

Second as a decimal number. (Platform specific) 5

%S

Second as a zero-padded decimal number. 05

%Z

Time zone name (empty string if the object is naive).

%z

UTC offset in the form +HHMM or -HHMM (empty string if the the object is naive).

%W

Week number of the year (Monday as the first day of the week) as a decimal number. All days in a new year preceding the first Monday are considered to be in week 0. 39

%U

Week number of the year (Sunday as the first day of the week) as a zero padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0. 39

%w

Weekday as a decimal number, where 0 is Sunday and 6 is Saturday. 1

%a

Weekday as locale's abbreviated name. Mon

%A

Weekday as locale's full name. Monday

%Y

Year with century as a decimal number. 2013

%y

Year without century as a zero-padded decimal number. 13

time.strftime()

converts a tuple or struct_time representing a time as returned by gmtime() or localtime() to a string as specified by the format argument.


Ensembles d'études connexes

9 клас карпюк Magic Box

View Set

heme pre-lecture questions all lectures

View Set

Solving Linear Equations and Inequalities

View Set