js date format epoch code example Example: convert date and time into epoch javascript var someDate = new Date(dateString); someDate = someDate.getTime();