ISO to datetime object: ‘z’ is a bad directive [duplicate]

Welcome to Python datetime! Dealing with dates and times is necessarily complex, and Python doesn’t come fully with batteries included in this case. You can’t use %z in strptime because Python has no classes to represent timezones (you are supposed to implement your own, or better yet include some other libraries). You want to use … Read more

ISO/IEC Website and Charging for C and C++ Standards

For what it’s worth, Herb Sutter wrote an article touching on this issue, and there’s a fair bit of discussion in the comments: http://herbsutter.com/2010/03/03/where-can-you-get-the-iso-c-standard-and-what-does-open-standard-mean/ As he mentions, “open” does not necessarily mean “no-cost”. As far as students or others with limited financial means who might want free versions of thee documents, note that: many references … Read more

Convert JSON date string to Python datetime

Try the following format: %Y-%m-%dT%H:%M:%S.%fZ For example: >>> datetime.datetime.strptime(‘2012-05-29T19:30:03.283Z’, ‘%Y-%m-%dT%H:%M:%S.%fZ’) datetime.datetime(2012, 5, 29, 19, 30, 3, 283000) The Z in the date just means that it should be interpreted as a UTC time, so ignoring it won’t cause any loss of information. You can find this information here: http://www.w3.org/TR/NOTE-datetime

Converting country codes in .NET

The RegionInfo class does know the three-letter code (in the ThreeLetterISORegionName property), but I don’t think there is a way to get RegionInfo based on this code, you would need to enumerate all regions and add them to your own dictionary, with the three-letter code as a key. However, I think the .NET Framework uses … Read more

In an ISO 8601 date, is the T character mandatory?

It’s required unless the “partners in information interchange” agree to omit it. Quoting an earlier version of the ISO 8601 standard, section 4.3.2: The character [T] shall be used as time designator to indicate the start of the representation of the time of day component in these expressions. […] NOTE By mutual agreement of the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)