how to get seconds from unix date java script code example Example: get current time epoch javascript var a = Date.now(); // Returns miliseconds since epoch