Skip to content

Default timezone isn't utc? #171

@leafonsword

Description

@leafonsword

From FAQ.
It also removes the notion of naive datetimes: each Pendulum instance is timezone-aware and by default in UTC for ease of use.
But from my test, seems dfault timezone is local machine's timezone, my machine's time zone is 'Asia/Shanghai'

>>> pendulum.now()                                                                                                                                               
<Pendulum [2018-01-05T15:51:55.975424+08:00]>       
                                                                                                             
>>> pendulum.now('Asia/Shanghai')                                                                                                                                
<Pendulum [2018-01-05T15:52:02.086741+08:00]>      
                                                                                                              
>>> pendulum.now().in_timezone('UTC')                                                                                                                            
<Pendulum [2018-01-05T07:52:27.614535+00:00]>                                                                                                                    
>>>                                                                                                                

So now() has same result like now('Asia/Shanghai'), not utc

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