Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php] Błąd strftime()
Forum PHP.pl > Forum > Przedszkole
starach
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 \
JaRoPHP
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. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.