Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] Błąd strftime(), Eeee o co chodzi ? Dlaczego jest to niebezpieczne ?
starach
post
Post #1





Grupa: Zarejestrowani
Postów: 999
Pomógł: 30
Dołączył: 14.01.2007
Skąd: wiesz ?

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


Cytat
Message: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '1.0/no DST' instead

edit>
Plik w którym występuje błąd:
  1. <?php
  2. public function _gc($maxlifetime)
  3. {
  4. $sess_live_time = strftime('%Y-%m-%d %H:%M', strtotime('-$maxlifetime seconds'));
  5. $this->db->query('DELETE FROM '.DB_PREFIX.DB_TBL_SESSION.' WHERE sess_last_update < ''.$sess_live_time.''');
  6. return $this->db->get_affected_rows();
  7. }
  8. ?>

edit>>
zmieniłem w strtotime cudzysłowy na apostrofy bo chyba IPD uznawał że próbuję się włamać na forum i dodawął mi przed ostatnim " backslash \

Ten post edytował orglee 10.02.2007, 22:38:19
Go to the top of the page
+Quote Post
JaRoPHP
post
Post #2





Grupa: Zarejestrowani
Postów: 675
Pomógł: 15
Dołączył: 7.11.2004
Skąd: Katowice

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


Przed wywołaniem funkcji operującej na dacie, wywołaj funkcję date_default_timezone_set" title="Zobacz w manualu php" target="_manual, np:
  1. <?php
  2. date_default_timezone_set('UTC');
  3. ?>


--------------------
Kto pyta, nie błądzi...
Kto zbłądził, ten pyta...
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 03:23