[issue33941] datetime.strptime not able to recognize invalid date formats

2018-06-22 Thread Raghunath Lingutla


New submission from Raghunath Lingutla :

Can not recognize invalid date values for %Y%m%d, %y%m%d, %Y%m%d %H:%M and few 
more formats. In Java we have setLenient option which help us to validate to 
pattern and convert only valid formats
Ex: datetime.strptime('181223', '%Y%m%d') 
For above input I am getting output as 1812-02-03 00:00:00 but expected output 
is error as ValueError: time data '181223' does not match format '%Y%m%d'

I tested below mentioned 4 modules. All modules giving same output

1) datetime.strptime

2) timestring.Date

3) parser.parse from dateutil

4) dateparser.parse

--
components: Tests
messages: 320233
nosy: Raghunath Lingutla
priority: normal
severity: normal
status: open
title: datetime.strptime not able to recognize invalid date formats
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue33941>
___
___
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 
<https://bugs.python.org/issue33940>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com