-
-
Save Savantos/5296654 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Some basic javascript Date examples | |
// NOTE: Javascript dates have 0 indexed months, because they are awesome | |
// January 1, 2012 (Chicago, IL) | |
var firstOfYear = new Date(2012, 0, 1), | |
// 6 Hour offset (before DST change) | |
hoursOffset = firstOfYear.getTimezoneOffset() / 60; | |
// April 1, 2012 (Chicago, IL) | |
var afterDST = new Date(2012, 3, 1), | |
// 5 Hour offset (after DST change) | |
hoursOffset = afterDST.getTimezoneOffset() / 60; | |
// November 16, 2012 (Chicago, IL) | |
var postDate = new Date(2012, 10, 16), | |
// 6 Hour offset (after DST change back) | |
hoursOffset = postDate.getTimezoneOffset() / 60; |
This file contains hidden or 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
# US central time, represented by Chicago | |
# Alabama, Arkansas, Florida panhandle (Bay, Calhoun, Escambia, | |
# Gulf, Holmes, Jackson, Okaloosa, Santa Rosa, Walton, and | |
# Washington counties), Illinois, western Indiana | |
# (Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer, | |
# Vanderburgh, and Warrick counties), Iowa, most of Kansas, western | |
# Kentucky, Louisiana, Minnesota, Mississippi, Missouri, eastern | |
# Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota, | |
# western Tennessee, most of Texas, Wisconsin | |
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER | |
Rule Chicago 1920 only - Jun 13 2:00 1:00 D | |
Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S | |
Rule Chicago 1921 only - Mar lastSun 2:00 1:00 D | |
Rule Chicago 1922 1966 - Apr lastSun 2:00 1:00 D | |
Rule Chicago 1922 1954 - Sep lastSun 2:00 0 S | |
Rule Chicago 1955 1966 - Oct lastSun 2:00 0 S |
This file contains hidden or 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
var someUTCDate = new Date(new Date().getTime()), | |
chicagoWallTime = WallTime.UTCToWallTime(someUTCDate, "America/Chicago"), | |
backToUTCTIme = WallTime.WallTimeToUTC("America/Chicago", chicagoWallTime); |
This file contains hidden or 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
<script src="/path/to/walltime-data.js"></script> | |
<script src="/path/to/walltime.js"></script> | |
<script type="text/javascript"> | |
var someUTCDate = new Date(new Date().getTime()), | |
chicagoWallTime = WallTime.UTCToWallTime(someUTCDate, "America/Chicago"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment