[New-bugs-announce] [issue26635] Python default date does not match Unix time

Itay Grudev report at bugs.python.org
Thu Mar 24 08:45:38 EDT 2016


New submission from Itay Grudev:

When parsing a time only string like:

```
datetime.datetime.strptime('13:48:25', '%H:%M:%S')
```

This produces:

```
datetime.datetime(1900, 1, 1, 13, 48, 25)
```

Not that the year is `1900` which just doesn't make sense. This will produce `-1` when you attempt to get it's UNIX timestamp. And while that sounds weird it is very useful.

The default year should be 1970. And this will resolve the issue.

----------
messages: 262337
nosy: Itay Grudev
priority: normal
severity: normal
status: open
title: Python default date does not match Unix time
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26635>
_______________________________________


More information about the New-bugs-announce mailing list