Dealing with Dates in Web Applications

The basic principles

Storing dates in UTC and performing all date calculations in UTC

Really, this part is pretty simple. I’ll let you figure it out on your own. Any details that I could provide here would be very implementation‐specific.

Display UTC dates in HTML in the users’ local time zone with JavaScript

Links for inspiration

Capturing form submissions with a JavaScript event handler and converting the dates entered into UTC before submission to the server

This example form submission handler JavaScript code creates UNIX timestamps for all specified date fields on the form.

Using the JavaScript form submission handler

The form submission handler requires jQuery.