Alex Rivera | Logout

How to convert date to milliseconds since 1970 using Javascript?

Asked 2011-10-07T03:43:08.463
10

I have these variables: (not literally, but this is what I obtain from a datepicker)

var StartMonth = "April";
var StartDate = "21";
var CurrentStartTime = "2"; 
var CurrentEndTime = "5";
var Startampm = "PM"; //corresponds to the CurrentStartTime
var Endampm = "PM"; //corresponds to the CurrentEndTime

I need to convert these variables to a single variable, milliseconds since 1970.

Edit
Report

1 Answer

-5

Use the Date class.

answered 2011-10-07T03:46:56.860

Your Answer