Message234835
Do I understand correctly that the request is to append '+00:00' to the result of dt.isoformat() when dt is naive? If so, -1. Python's datetime module does not dictate how naive datetime instances should be interpreted. UTC by default and local by default are both valid choices, but local by default is often preferable. There are at least two reasons for that:
1. Local time is the "naïve" time. Using UTC implies certain amount of sophistication.
2. Interpreting naive times as UTC is unnecessary because it is very easy to create aware instances with tzinfo=timezone.utc.
When communicating with javascript and in general when writing software for the Internet, I recommend using aware datetime instances. For example,
>>> from datetime import *
>>> datetime.now(timezone.utc).isoformat()
'2015-01-27T18:27:33.216857+00:00' |
|
Date |
User |
Action |
Args |
2015-01-27 18:47:49 | belopolsky | set | recipients:
+ belopolsky, r.david.murray, mirkovogt |
2015-01-27 18:47:49 | belopolsky | set | messageid: <1422384469.17.0.980483817752.issue23332@psf.upfronthosting.co.za> |
2015-01-27 18:47:49 | belopolsky | link | issue23332 messages |
2015-01-27 18:47:48 | belopolsky | create | |
|