Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

date format Unix epoch 'U' ??

0 views
Skip to first unread message

Erwin

unread,
Aug 24, 2008, 10:10:02 AM8/24/08
to
writing that :
<input id="vacancy_start" name="vacancy_start" onchange="alert( new
Date($('vacancy_start').value) );"
....
I get :
Mon Aug 25 2008 00:00:00 GMT+0200 (CEST)
which is OK


I would like to get the Unix epoch time , so I wrote :

<input id="vacancy_start" name="vacancy_start" onchange="alert( new
Date($('vacancy_start').value).dateFormat('U') );"
.....

but I get an error :

Error : (new Date($("vacancy_start").value)).format is not a function


what's wrong ?

thanks for your help

erwin

SAM

unread,
Aug 24, 2008, 7:45:12 PM8/24/08
to
Erwin a écrit :

> writing that :
> <input id="vacancy_start" name="vacancy_start" onchange="alert( new
> Date($('vacancy_start').value) );"
> ....
> I get :
> Mon Aug 25 2008 00:00:00 GMT+0200 (CEST)
> which is OK
>
>
> I would like to get the Unix epoch time , so I wrote :
>
> <input id="vacancy_start" name="vacancy_start" onchange="alert( new
> Date($('vacancy_start').value).dateFormat('U') );"

dateFormat is a Java function, not a JavaScript one.

<input id="vacancy_start" name="vacancy_start"

onchange="alert( new Date(this.value).getTime()/1000 );">

<http://www.esqsoft.com/javascript_examples/date-to-epoch.htm>

Google is your friend.

--
sm

Erwin

unread,
Aug 26, 2008, 5:55:27 PM8/26/08
to
On 25 août, 01:45, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:

merci, thanks .. je comprends mieux maintenant ...

SAM

unread,
Aug 27, 2008, 5:44:35 AM8/27/08
to
Erwin a écrit :

> On 25 août, 01:45, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
> wrote:
>>
>> <input id="vacancy_start" name="vacancy_start"
>> onchange="alert( new Date(this.value).getTime()/1000 );">
>>
>> <http://www.esqsoft.com/javascript_examples/date-to-epoch.htm>
>
> merci, thanks .. je comprends mieux maintenant ...

tant mieux parce que, perso, les dates ça me reste bien compliqué.
Un espécialiste Me EsDates et EsCalendriers :

<http://www.merlyn.demon.co.uk/js-date0.htm>
<http://www.merlyn.demon.co.uk/js-dates.htm>
<http://www.merlyn.demon.co.uk/js-dates.htm#ODp>

--
sm

Dr J R Stockton

unread,
Aug 27, 2008, 4:21:21 PM8/27/08
to
En fr.comp.lang.javascript message <48b52204$0$930$ba4a...@news.orange.
fr>, 27 Aout 2008 11:44:35, SAM <stephanemor...@wanadoo.fr.inva
lid> a ecrit :

>tant mieux parce que, perso, les dates ça me reste bien compliqué.
>Un espécialiste Me EsDates et EsCalendriers :
>
><http://www.merlyn.demon.co.uk/js-date0.htm>
><http://www.merlyn.demon.co.uk/js-dates.htm>
><http://www.merlyn.demon.co.uk/js-dates.htm#ODp>

<g>

Ou /via/ <http://translate.google.com/translate?client=tmpg&hl=en&u=http
://www.merlyn.demon.co.uk/index.htm&langpair=en|fr>.


H'mm - La, Google me dit "Le Nouveau-Brunswick SetTime, getTime ..." ;
Google dit que le page Anglais dit "NB The setTime, getTime ..." et
actuellement le page Anglais dit "N.B. The setTime, getTime ..." et
j'ai ecrit "<p><b>N.B.</b> The <tt>setTime, getTime</tt> " !

Et N.B. en *Anglais*, c'est North Britain, point New Brunswick, qui est
seulement Canadien. North Britain est une euphemisme pour l'Ecosse.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF2 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

SAM

unread,
Aug 27, 2008, 10:36:06 PM8/27/08
to
Dr J R Stockton a �crit :

> En fr.comp.lang.javascript message <48b52204$0$930$ba4a...@news.orange.
> fr>, 27 Aout 2008 11:44:35, SAM <stephanemor...@wanadoo.fr.inva
> lid> a ecrit :
>
> Un esp�cialiste Me EsDates et EsCalendriers :

Alors l� ! ce n'est vraiment pas � recommander !
Autant tenter de lire en VO m�me si on fait qques contre sens.

> H'mm - La, Google me dit "Le Nouveau-Brunswick SetTime, getTime ..." ;

(...)


> Et N.B. en *Anglais*, c'est North Britain, point New Brunswick, qui est
> seulement Canadien. North Britain est une euphemisme pour l'Ecosse.

L'est nul ce Google, il ne connait que le nouveau monde!

--
sm

0 new messages