shimniok

Daylight Savings Time Mockup

Mar 20th, 2014
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. # Mocking up daylight savings time detection
  2. # with primitive Arduino Time API.
  3. xday = day-weekday
  4. if (month > 3 and month < 11):
  5.     dst = "DST"
  6. elif (month == 3):
  7.     if (xday >= 7):
  8.         dst = "DST"
  9.     elif (xday >= 0):
  10.         if (weekday > 1):
  11.             dst = "DST"
  12.         elif (hour >= 2):
  13.             dst = "DST"
  14. elif (month == 11):
  15.     if (xday >= 14):
  16.         dst = "DST"
  17.     elif (xday >= 7):
  18.         if (weekday > 1):
  19.             dst = "DST"
  20.         elif (hour >= 2):
  21.             dst = "DST"
  22. # www-bot-thoughts.com
Advertisement
Add Comment
Please, Sign In to add comment