I am trying to convert timestamp 2016-02-11 03:31:18 to pubnub timestamp of 17-digit precision unix time (UTC) something like 13406746780720711 given in reference url given by pubnub I have tried following but no luck
function parseDateTime(s) {
var b = s.split(/\D/);
return new Date(b[0],b[1]-1,b[2],b[3],b[4],b[5])
}
date = new Date(parseDateTime("2015-02-11 02:10:54") / 10000);
console.log(date.getTime());//142360085
Above example gives output 142360085
which is 10 characters where pubnub asks for 17 digit timestamp.
Reason behind doing this is i want to fetch unread messages of particular user and send an email at EOD via email.
After converting mytimestamp to 17-digit precision unix time (UTC) i will pass it to pubnub history function and get unread messages.