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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -