Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

date format Unix epoch 'U' ??

5 réponses
Avatar
Erwin
writing that :
<input id=3D"vacancy_start" name=3D"vacancy_start" onchange=3D"alert( new
Date($('vacancy_start').value) );"
=2E...
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=3D"vacancy_start" name=3D"vacancy_start" onchange=3D"alert( new
Date($('vacancy_start').value).dateFormat('U') );"
=2E....

but I get an error :

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


what's wrong ?

thanks for your help

erwin

5 réponses

Avatar
SAM
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
Avatar
Erwin
On 25 août, 01:45, SAM
wrote:
Erwin a écrit :

> writing that :
> <input id="vacancy_start" name="vacancy_start" onchange="alert( n ew
> 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( n ew
> 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



merci, thanks .. je comprends mieux maintenant ...
Avatar
SAM
Erwin a écrit :
On 25 août, 01:45, SAM
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
Avatar
Dr J R Stockton
En fr.comp.lang.javascript message <48b52204$0$930$
fr>, 27 Aout 2008 11:44:35, SAM
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.
Avatar
SAM
Dr J R Stockton a écrit :
En fr.comp.lang.javascript message <48b52204$0$930$
fr>, 27 Aout 2008 11:44:35, SAM
lid> a ecrit :

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>



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



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