![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Public Member Functions | |
| None | __init__ (self, datetime.date|datetime.time value, Locale|str locale, datetime.date|None reference_date=None) |
| str | __getitem__ (self, str name) |
| int | extract (self, str char) |
| str | format_era (self, str char, int num) |
| str | format_year (self, str char, int num) |
| str | format_quarter (self, str char, int num) |
| str | format_month (self, str char, int num) |
| str | format_week (self, str char, int num) |
| str | format_weekday (self, str char='E', int num=4) |
| str | format_day_of_year (self, int num) |
| str | format_day_of_week_in_month (self) |
| str | format_period (self, str char, int num) |
| str | format_frac_seconds (self, int num) |
| format_milliseconds_in_day (self, num) | |
| str | format_timezone (self, str char, int num) |
| str | format (self, SupportsInt value, int length) |
| int | get_day_of_year (self, datetime.date|None date=None) |
| int | get_week_of_year (self) |
| int | get_week_of_month (self) |
| int | get_week_number (self, int day_of_period, int|None day_of_week=None) |
Public Attributes | |
| value | |
| locale | |
| reference_date | |
Static Public Attributes | |
| dict | PATTERN_CHARS |
| str babel.dates.DateTimeFormat.format_frac_seconds | ( | self, | |
| int | num | ||
| ) |
Return fractional seconds. Rounds the time's microseconds to the precision given by the number \ of digits passed in.
| str babel.dates.DateTimeFormat.format_period | ( | self, | |
| str | char, | ||
| int | num | ||
| ) |
Return period from parsed datetime according to format pattern.
>>> from datetime import datetime, time
>>> format = DateTimeFormat(time(13, 42), 'fi_FI')
>>> format.format_period('a', 1)
u'ip.'
>>> format.format_period('b', 1)
u'iltap.'
>>> format.format_period('b', 4)
u'iltapäivä'
>>> format.format_period('B', 4)
u'iltapäivällä'
>>> format.format_period('B', 5)
u'ip.'
>>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant')
>>> format.format_period('a', 1)
u'上午'
>>> format.format_period('B', 1)
u'清晨'
:param char: pattern format character ('a', 'b', 'B')
:param num: count of format character
| str babel.dates.DateTimeFormat.format_weekday | ( | self, | |
| str | char = 'E', |
||
| int | num = 4 |
||
| ) |
Return weekday from parsed datetime according to format pattern.
>>> from datetime import date
>>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US'))
>>> format.format_weekday()
u'Sunday'
'E': Day of week - Use one through three letters for the abbreviated day name, four for the full (wide) name,
five for the narrow name, or six for the short name.
>>> format.format_weekday('E',2)
u'Sun'
'e': Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the
week, using one or two letters. For this example, Monday is the first day of the week.
>>> format.format_weekday('e',2)
'01'
'c': Stand-Alone local day of week - Use one letter for the local numeric value (same as 'e'), three for the
abbreviated day name, four for the full (wide) name, five for the narrow name, or six for the short name.
>>> format.format_weekday('c',1)
'1'
:param char: pattern format character ('e','E','c')
:param num: count of format character
| int babel.dates.DateTimeFormat.get_week_number | ( | self, | |
| int | day_of_period, | ||
| int | None | day_of_week = None |
||
| ) |
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.
>>> date = datetime.date(2006, 1, 8)
>>> DateTimeFormat(date, 'de_DE').get_week_number(6)
1
>>> DateTimeFormat(date, 'en_US').get_week_number(6)
2
:param day_of_period: the number of the day in the period (usually
either the day of month or the day of year)
:param day_of_week: the week day; if omitted, the week day of the
current date is assumed
| int babel.dates.DateTimeFormat.get_week_of_month | ( | self | ) |
Return the week of the month.
| int babel.dates.DateTimeFormat.get_week_of_year | ( | self | ) |
Return the week of the year.
|
static |