This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var serverDate = '2014-02-24 04:52:48.050000'; // EST | |
function convertServerDateToLocal(dateInput) { | |
// EST - UTC offset: 5 hours | |
var offset = 5.0, | |
/* | |
- calculate the difference between the server date and UTC | |
- the value returned by the getTime method is the number of milliseconds since 1 January 1970 00:00:00 UTC. | |
- the time-zone offset is the difference, in minutes, between UTC and local time |
/* Inspired from http://tutsplus.com/lesson/custom-events-and-the-observer-pattern/ */ | |
(function( $ ) { | |
var o = $( {} ); | |
$.each({ | |
trigger: 'publish', | |
on: 'subscribe', | |
off: 'unsubscribe' |
<!doctype html> | |
<html> | |
<head> | |
<meta charset=utf-8> | |
<title></title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer