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