class DateTimeFormat(object):
Undocumented
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | extract |
Undocumented |
Method | format |
Undocumented |
Method | format_day_of_week_in_month |
Undocumented |
Method | format_day_of_year |
Undocumented |
Method | format_era |
Undocumented |
Method | format_frac_seconds |
Return fractional seconds. |
Method | format_milliseconds_in_day |
Undocumented |
Method | format_month |
Undocumented |
Method | format_period |
Undocumented |
Method | format_quarter |
Undocumented |
Method | format_timezone |
Undocumented |
Method | format_week |
Undocumented |
Method | format_weekday |
Return weekday from parsed datetime according to format pattern. |
Method | format_year |
Undocumented |
Method | get_day_of_year |
Undocumented |
Method | get_week_number |
Return the number of the week of a day within a period. This may be the week number in a year or the week number in a month. |
Instance Variable | locale |
Undocumented |
Instance Variable | value |
Undocumented |
Return fractional seconds.
Rounds the time's microseconds to the precision given by the number of digits passed in.
Return weekday from parsed datetime according to format pattern.
>>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US')) >>> format.format_weekday() u'Sunday'
>>> format.format_weekday('E',2) u'Sun'
>>> format.format_weekday('e',2) '01'
>>> format.format_weekday('c',1) '1'
Parameters | |
char | pattern format character ('e','E','c') |
num | count of format character |
Return the number of the week of a day within a period. This may be the week number in a year or the week number in a month.
Usually this will return a value equal to or greater than 1, but if the first week of the period is so short that it actually counts as the last week of the previous period, this function will return 0.
>>> format = DateTimeFormat(date(2006, 1, 8), Locale.parse('de_DE')) >>> format.get_week_number(6) 1
>>> format = DateTimeFormat(date(2006, 1, 8), Locale.parse('en_US')) >>> format.get_week_number(6) 2
Parameters | |
day_of_period | the number of the day in the period (usually either the day of month or the day of year) |
day_of_week | the week day; if ommitted, the week day of the current date is assumed |