Azure/azure-sdk-for-python — pull request #201 by huguesv (2014-08-27 18:14:16+00:00)
Title: Add support for timezone for table storage DateTime entity data type and fixes parsing of DateTime values that were created from C#.

#114 Timezone information 'Z' is ignored during parsing of datetime of table entity
#116 def _from_entity_datetime(value) in __init__.py returns 7 for seconds

NOTE: We now have a dependency on python-dateutil.

NEW BEHAVIOR:

When writing the value to Azure, it expects a datetime that is UTC based. We convert to UTC when it's possible (when the datetime has a tzinfo). If not possible, then we treat it as UTC.

Azure always returns a UTC datetime (string ends with Z), so dateutil's parser will set the tzinfo to UTC on the datetime that is returned in the entity.

OLD BEHAVIOR:

When writing the value to Azure, we ignored the tzinfo if there was one, effectively treating it as UTC. If there was a timezone and it was UTC, then the behavior just happened to be correct. If it was some other than UTC, then we gave Azure the wrong value.

When reading the value from Azure, we weren't setting the tzinfo, and returned a naive datetime.