Created
April 4, 2011 21:33
-
-
Save rfc1459/902485 to your computer and use it in GitHub Desktop.
In L'Aquila we're still waiting for Apr 7 00:00:00 2009...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# In L'Aquila we're still waiting for Apr 7 00:00:00 2009... | |
import time | |
__all__ = ['eternal_april'] | |
_APRIL_MIDNIGHT = 1238968800.0 | |
def eternal_april(ts=None): | |
assert ts >= _APRIL_MIDNIGHT or ts is None, "Negative time delta" | |
if ts is None: | |
ts = time.time() | |
days = int((ts - _APRIL_MIDNIGHT) / (60.0**2)) | |
ltime = time.localtime(ts) | |
return time.strftime("Mon Apr 6 %d:%%M:%%S CEST 2009" % days, ltime) | |
if __name__ == '__main__': | |
print eternal_april() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment