Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] [OT] Subtracting two times in JavaScript



Godwin, Edmund, Lewske, Fredricson,

Thanks so much for responding.

I think Godwin's got the way to go, but I'm having a little trouble
implementing it.

Problem one is that Firebug keeps giving me the error "elapsed.slice is
not a function". I looked it up on the web, and slice is most definitely
a function, so I figure something is wrong with the variable "elapsed".

Not entirely sure, but then I found out that some of my time stamps were
not right.

So now I'm questioning this:

var now = Math.round(new Date().getTime() / 1000);


I got it off the web, and it seemed to be the way to create a Unix time
stamp. But it seems to only set an amount of time, but leaves the date
as January 1st, 1970.

So, before I debug the slice error, I need to know how can I get a nice,
properly formatted, and accurate Unix time stamp in Javascript?

-- 
Dave M G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links