Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js] Aktualna data w inpucie
Morale
post
Post #1





Grupa: Zarejestrowani
Postów: 152
Pomógł: 2
Dołączył: 28.03.2007

Ostrzeżenie: (0%)
-----


Jak do inputa do value wpisać aktualną datę w takim formacie:

Cytat
12.09.2007 15:12:11
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
legorek
post
Post #2





Grupa: Zarejestrowani
Postów: 411
Pomógł: 35
Dołączył: 27.06.2004
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Na szybko:
  1. <input type="text" id="data">
  2. data = new Date();
  3. document.getElementById('data').value = data.getDay()+'-'+data.getMonth()+'-'+data.getFullYear()+' '+data.getHours()+':'+data.getMinutes()+':'+data.getSeconds();


Musisz tylko poprawcować nad formatowaniem (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

  1. <?php
  2. echo"$data";
  3. ?>


O mamo, ale potworek (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 11:21