Skip to content

Instantly share code, notes, and snippets.

@stevepeak
Last active December 20, 2015 00:19
Show Gist options
  • Select an option

  • Save stevepeak/6041432 to your computer and use it in GitHub Desktop.

Select an option

Save stevepeak/6041432 to your computer and use it in GitHub Desktop.
Your Time is not My Time - An epic journey through time and a mans quest to understand his place in it.

Your Time is not My Time

An epic journey through time and a mans quest to understand his place in it.

Chapter 1 - The Laws of Time

  • timezone does not effect unix_timestamps
SET time_zone='-05:00';
SELECT unix_timestamp();` # this
SET time_zone='-06:00';
SELECT unix_timestamp(); # equals this
  • timezone ONLY come into play when converting from strings to unixtime.
    • in mysql comparing unixtimes ignores timezone
  • the system timezone does effect time strings but not unixtime
import time,os;
os.environ['TZ'] = 'UTC'
time.tzset()
date1 = datetime.datetime.now()
os.environ['TZ'] = 'US/Central'
time.tzset();
date2 = datetime.datetime.now();

ThisIsTrue = (date1.hour != date2.hour)

Chapter 2 - Daylight Savings

  • not only does it not Save time but it wastes mine
  • starts on second Sunday in March (DST) && ends on the first Sunday in November (STD)
  • random locations do not observe Daylight Savings. I'll move to one of these locations some day.

Synapse

End the madness this is a call to action to tell your local politicians they need to vote agains DST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment