New JavaScript date object from seconds of a day -
seems simple can't figure out. sigh
i have 74141 seconds in day, how create date object number represent time in hours , seconds? actual date don't care because i'm going using gethours/seconds/minutes set date has correct date.
you can use date.prototype.setseconds purpose. don't need worry conversion, automatic:
var date = new date(1970, 0, 1); date.setseconds(secs);
the above trick relies on fact date
points midnight, timing precise. precision reasons, using epoch, although "exact" midnight do.
Comments
Post a Comment