[issue25149] datetime.weekday() off by one if handling a date from utcfromtimestamp()

2015-09-17 Thread AndreC

New submission from AndreC:

I've stumbled over an odd datetime.weekday() behaviour in Python 2.7.8 
(default, Jun 18 2015, 18:54:19)  [GCC 4.9.1] on linux2) under Ubuntu. 
weekday() is off by 1.

Code to reproduce:

from datetime import datetime
date = datetime.utcfromtimestamp(int('1410446564'))  # datetime.datetime(2014, 
9, 11, 14, 42, 44)
date.weekday()  # should be 4, not 3

I can reproduce this behaviour on our dev and production systems, and just 
tested it locally with python 3.4.3.

Since I'm not a smart man, I might overlook something silly...

--
components: Library (Lib)
messages: 250881
nosy: odianus
priority: normal
severity: normal
status: open
title: datetime.weekday() off by one if handling a date from utcfromtimestamp()
type: behavior
versions: Python 2.7, Python 3.4

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



[issue25149] datetime.weekday() off by one if handling a date from utcfromtimestamp()

2015-09-17 Thread AndreC

AndreC added the comment:

as I said, I'm not a smart man, the sort order was wrong and the year was 
simply wrong... sorry :-/

--
resolution:  -> not a bug
status: open -> closed

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