[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-10-29 Thread Alexander Belopolsky


Change by Alexander Belopolsky :


--
superseder:  -> %Z in strptime doesn't match EST and others

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-10-29 Thread Alexander Belopolsky


Change by Alexander Belopolsky :


--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-10-29 Thread Alexander Belopolsky


Alexander Belopolsky  added the comment:

Since the Python datetime only supports dates within 0001-01-01 through 
-12-31 range, it is not clear how we can meaningfully support the AD/BC era 
designation.

Looking at man strftime page on my Mac, I see that they use every upper an 
lower case letter as a valid format specifier, but they still not have a letter 
code for AD/BC.  In the "BUGS" section they humorousely complain that "There is 
no conversion specification for the phase of the moon" which makes me think 
that the moon phase designations are higher on some people agenda than the era 
designations.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-09-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the report Raghunath. Regarding timezone detection there is a 
limitation with %Z supporting only UTC, GMT and `time.tzname` which is not 
documented and it's an open issue tracked at issue22377 . Regarding a directive 
to determine Era I think it falls under a feature request and compile error is 
used for errors during compiling python interpreter itself. So I am changing 
this from compile error to enhancement.

# Support for GMT, UTC and error on PDT

$ ./python.exe
Python 3.8.0a0 (heads/master:f6c8007a29, Sep 25 2018, 12:30:43)
[Clang 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.strptime("2018-06-14 10:10:11 GMT", "%Y-%m-%d %H:%M:%S 
>>> %Z")
datetime.datetime(2018, 6, 14, 10, 10, 11)
>>> datetime.datetime.strptime("2018-06-14 10:10:11 UTC", "%Y-%m-%d %H:%M:%S 
>>> %Z")
datetime.datetime(2018, 6, 14, 10, 10, 11)
>>> datetime.datetime.strptime("2018-06-14 10:10:11 PDT", "%Y-%m-%d %H:%M:%S 
>>> %Z")
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_strptime.py", 
line 568, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/_strptime.py", 
line 349, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2018-06-14 10:10:11 PDT' does not match format '%Y-%m-%d 
%H:%M:%S %Z'

Hope this helps!

Thanks

--
type: compile error -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-09-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-07-05 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-06-22 Thread Ned Deily


Change by Ned Deily :


--
nosy:  -lemburg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-06-22 Thread Ned Deily


Change by Ned Deily :


--
nosy: +belopolsky, lemburg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33940] datetime.strptime have no directive to convert date values with Era and Time Zone name

2018-06-22 Thread Raghunath Lingutla


New submission from Raghunath Lingutla :

Python3.6 module datetime.strptime didn't have directive to convert date values 
having Era designator (AD or BC) and time zone (Ex: EST, PST, -07:00)

Below are few example for date values which are not supported

2018-04-14 12:08:56 EST

2018-05-23 11:03:43 PST

2017-12-24 AD 12:08:56

2018-05-23 11:03:43 +05:30

--
components: Extension Modules
messages: 320231
nosy: RaghunathLingutla
priority: normal
severity: normal
status: open
title: datetime.strptime have no directive to convert date values with Era and 
Time Zone name
type: compile error
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com