Back to Top

Thursday, February 07, 2013

Converting datetime to UTC in python


So you need to convert a python datetime object which has a timezone set ("aware" in the Python nomenclature) to an UTC one with no timezone set ("naive"), for example because NDB on GAE can't store anything else. The solution will look something like this:

date = date.astimezone(tz.tzutc()).replace(tzinfo=None)
For searcheability: the exception thrown by NDB if you fail to do this is "NotImplementedError: DatetimeProperty updated_at can only support UTC. Please derive a new Property to support alternative timezones."

Tuesday, February 05, 2013

Recovering your RoTLD password for domains registered trough Gandi.NET


If you need to "recover" your RoTLD password when the .RO domain is registered trough Gandi.NET (I say "recover" because you didn't set it in the first place :-)) - do this:

  • In the Gandi interface go to Account Management -> Update account information and set "Anti-spam system" to No
  • Go to the RoTLD password recovery page and reset your password. Now the password recovery email should have arrived to your inbox.
  • (Optional) go back to the Gandi interface and re-enable the anti-spam system

I needed to do this to enable CloudFlare on IT-Events.RO because RoTLD allows the changing of nameservers only trough their website.