Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem sa strtotime

[es] :: PHP :: Problem sa strtotime

[ Pregleda: 618 | Odgovora: 4 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

kukipei
Niš

Član broj: 19564
Poruke: 147
*.adsl-1.sezampro.yu.

Sajt: www.gensunasumus.com


Profil

icon Problem sa strtotime03.04.2007. u 08:14

Pozdrav svima

Imam jedan problem sa sledecim kodom:

Code:

$timeproblem = 1174745298;
echo $timeproblem."<br>";
echo date ("F d Y H:i:s.", $timeproblem);
echo "<br>";
echo strtotime(date ("F d Y H:i:s.", $timeproblem));


Ovaj kod na nekim serverima radi kako treba. Izlaz sa takvog servera:
1174745298
March 24 2007 15:08:18.
1174745298


Medjutim na jednom serveru dobijam sledeci izlaz:
1174745298
March 24 2007 15:08:18.
-1

Znaci f-ja strtotime mi vraca vrednost -1.

Da li neko zna zasto se ovo desava

na oba servera je OS linux a PHP verzija 4.nesto
03.04.2007. u 08:14 

Jbyn4e
Admin/Developer, Yunix
Zrenjanin - Beograd

Član broj: 422
Poruke: 3859
*.ptt.yu.

ICQ: 10450578
Sajt: bio sf.co.yu


Profil

icon Re: Problem sa strtotime03.04.2007. u 08:19
Pogledaj
http://www.php.net/strtotime
i sve ce ti se samo kas'ti.
03.04.2007. u 08:19 

kukipei
Niš

Član broj: 19564
Poruke: 147
212.200.219.*

Sajt: www.gensunasumus.com


Profil

icon Re: Problem sa strtotime03.04.2007. u 08:50
Gledao sam.
Al opet nisam mogao da resim.

Pozdrav
03.04.2007. u 08:50 

kukipei
Niš

Član broj: 19564
Poruke: 147
212.200.219.*

Sajt: www.gensunasumus.com


Profil

icon Re: Problem sa strtotime03.04.2007. u 09:39
Nasao sam gresku.

Ovo je kod koji radi:
Code:
$timeproblem = 1174745298;
echo $timeproblem."<br>";
echo date ("F d Y H:i:s", $timeproblem);
echo "<br>";
echo strtotime(date ("F d Y H:i:s", $timeproblem));


samo sam obrisao .(tacku) iza H:i:s. u naredbi date
03.04.2007. u 09:39 

Jbyn4e
Admin/Developer, Yunix
Zrenjanin - Beograd

Član broj: 422
Poruke: 3859
*.static.sbb.co.yu.

ICQ: 10450578
Sajt: bio sf.co.yu


Profil

icon Re: Problem sa strtotime03.04.2007. u 15:41
NIsam mislio na to. Mislio sam na ovo:
Citat:

Return Values

Returns a timestamp on success, FALSE otherwise. Previous to PHP 5.1.0, this function would return -1 on failure.
Errors/Exceptions

Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT message if using the system settings or the TZ environment variable.

03.04.2007. u 15:41 

[es] :: PHP :: Problem sa strtotime

[ Pregleda: 618 | Odgovora: 4 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.