Skip to content

DST #5

@Brightcells

Description

@Brightcells

Error

In [1]: from TimeConvert import TimeConvert as tc

In [2]: tc.string_to_datetime('1988-08-08 08:08:08')
Out[2]: datetime.datetime(1988, 8, 8, 8, 8, 8)

In [3]: tc.string_to_utc_datetime('1988-08-08 08:08:08')
Out[3]: datetime.datetime(1988, 8, 7, 23, 8, 8, tzinfo=<UTC>)

In [4]: tc.string_to_local_datetime('1988-08-08 08:08:08')
Out[4]: datetime.datetime(1988, 8, 8, 9, 8, 8, tzinfo=<DstTzInfo 'Asia/Shanghai' CDT+9:00:00 DST>)

In [5]: tc.string_to_datetime('2016-08-08 08:08:08')
Out[5]: datetime.datetime(2016, 8, 8, 8, 8, 8)

In [6]: tc.string_to_utc_datetime('2016-08-08 08:08:08')
Out[6]: datetime.datetime(2016, 8, 8, 0, 8, 8, tzinfo=<UTC>)

In [7]: tc.string_to_local_datetime('2016-08-08 08:08:08')
Out[7]: datetime.datetime(2016, 8, 8, 8, 8, 8, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>)

In [8]: tc.to_local_datetime(_3)
Out[8]: datetime.datetime(1988, 8, 8, 8, 8, 8, tzinfo=<DstTzInfo 'Asia/Shanghai' CDT+9:00:00 DST>)

In [9]: tc.to_local_datetime(_6)
Out[9]: datetime.datetime(2016, 8, 8, 8, 8, 8, tzinfo=<DstTzInfo 'Asia/Shanghai' CST+8:00:00 STD>)

TOADD

is_dst()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions