Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some confusion about timestamp when use AM and PM ! #160

Closed
douglarek opened this issue Aug 25, 2014 · 3 comments
Closed

Some confusion about timestamp when use AM and PM ! #160

douglarek opened this issue Aug 25, 2014 · 3 comments

Comments

@douglarek
Copy link
Contributor

In [2]: arrow.get('2014-08-25 12:00 PM', 'YYYY-MM-DD h:mm A')
Out[2]: <Arrow [2014-08-25T12:00:00+00:00]>

In [3]: arrow.get('2014-08-25 6:00 PM', 'YYYY-MM-DD h:mm A')
Out[3]: <Arrow [2014-08-25T12:00:00+00:00]>

In [4]: arrow.get('2014-08-25 6:00 PM', 'YYYY-MM-DD h:mm A').to('local')
Out[4]: <Arrow [2014-08-25T20:00:00+08:00]>

In [5]: arrow.get('2014-08-25 12:00 PM', 'YYYY-MM-DD h:mm A').to('local')
Out[5]: <Arrow [2014-08-25T20:00:00+08:00]>

In [6]: arrow.get('2014-08-25 6:00 PM', 'YYYY-MM-DD h:mm A').timestamp
Out[6]: 1408968000

In [7]: arrow.get('2014-08-25 12:00 PM', 'YYYY-MM-DD h:mm A').timestamp
Out[7]: 1408968000

In [8]: arrow.get('2014-08-25 12:00 PM', 'YYYY-MM-DD h:mm A').to('local').timestamp
Out[8]: 1408968000

In [9]: arrow.get('2014-08-25 6:00 PM', 'YYYY-MM-DD h:mm A').to('local').timestamp
Out[9]: 1408968000

Anyone can help explain where i am lost ?

@ppinette
Copy link

+1

My format is 'M/D/YYYY h:mm A'

Any arrow.get() call returns the correct date and minutes, but the hour is always either 00 or 12.

In [6]: arrow.get('9/8/1981 2:15 AM', 'M/D/YYYY h:mm A')
Out[6]: <Arrow [1981-09-08T00:15:00+00:00]>

In [7]: arrow.get('9/8/1981 2:15 PM', 'M/D/YYYY h:mm A')
Out[7]: <Arrow [1981-09-08T12:15:00+00:00]>

GitVivek added a commit to GitVivek/arrow that referenced this issue Dec 20, 2014
@andrewelkins
Copy link
Contributor

Fixed by GitVivek

@andrewelkins
Copy link
Contributor

Will do.

On Wed, Oct 7, 2015 at 12:49 AM, Lingchao Xin notifications@github.com
wrote:

@andrewelkins https://github.com/andrewelkins would you please release
a new version for this patch?


Reply to this email directly or view it on GitHub
#160 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants