pytilpack.datetime¶
pytilpack.datetime
¶
datetime関連。
YearMonth(year, month)
dataclass
¶
YearMonthDay(year, month, day)
dataclass
¶
fromiso(iso_str, tz=None, remove_tz=False)
¶
ISO形式の文字列をdatetimeオブジェクトに変換する。
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
iso_str
|
str
|
ISO形式の文字列。 |
必須 |
tz
|
ZoneInfo | str | None
|
タイムゾーン。 |
None
|
remove_tz
|
bool
|
タイムゾーン情報を削除するかどうか。 |
False
|
ソースコード位置: pytilpack/datetime.py
toutc(dt)
¶
UTCのdatetimeオブジェクトに変換する。
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
dt
|
datetime
|
変換するdatetimeオブジェクト。 |
必須 |
戻り値:
| タイプ | デスクリプション |
|---|---|
datetime
|
datetime.datetime: UTCのdatetimeオブジェクト。 |