[issue12750] datetime.datetime timezone problems

2011-08-15 Thread Ben Finney
Changes by Ben Finney : -- nosy: +bignose ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue12750] datetime.datetime timezone problems

2011-08-15 Thread Daniel O'Connor
Daniel O'Connor added the comment: On 16/08/2011, at 1:06, R. David Murray wrote: > R. David Murray added the comment: > > Ah. Well, pre-3.2 datetime itself did not generate *any* non-naive datetimes. > > Nor do you need to specify everything for replace. dt.replace(tzinfo=tz) > should wor

[issue12750] datetime.datetime timezone problems

2011-08-15 Thread R. David Murray
R. David Murray added the comment: Ah. Well, pre-3.2 datetime itself did not generate *any* non-naive datetimes. Nor do you need to specify everything for replace. dt.replace(tzinfo=tz) should work just fine. -- resolution: -> invalid stage: -> committed/rejected status: open -> c

[issue12750] datetime.datetime timezone problems

2011-08-15 Thread Daniel O'Connor
Daniel O'Connor added the comment: On 15/08/2011, at 23:39, R. David Murray wrote: > R. David Murray added the comment: > > In what way does 'replace' not satisfy your need to set the tzinfo? Ahh that would work, although it is pretty clumsy since you have to specify everything else as well.

[issue12750] datetime.datetime timezone problems

2011-08-15 Thread R. David Murray
R. David Murray added the comment: In what way does 'replace' not satisfy your need to set the tzinfo? As for utcnow, we can't change what it returns for backward compatibility reasons, but you can get a non-naive utc datatime by doing datetime.now(timezone.utc). (I must admit, however, that

[issue12750] datetime.datetime timezone problems

2011-08-14 Thread Daniel O'Connor
New submission from Daniel O'Connor : It isn't possible to add a timezone to a naive datetime object which means that if you are getting them from some place you can't directly control there is no way to set the TZ. eg pywws' DataStore returns naive datetime's which are in UTC. There is no way