Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> funkcja daty w php 5.3.1
adzik511
post 23.10.2013, 19:49:12
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 2.06.2013

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


Witam
Zaczynam zabawe z php i zainstolwałem Appache xamp .Napisałem taki kod:

  1. <?php
  2. $uzytkownik="Marek";
  3. ?>
  4.  
  5.  
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
  7. <head>
  8. <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  9.  
  10.  
  11. <title> </title>
  12.  
  13.  
  14. </head>
  15. <body>
  16. <?php echo 'Witaj '; echo $uzytkownik;echo date('d-m-Y') ?>
  17. </body>
  18. </html>


i wyskakuje mi komunikat
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting 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 '2.0/DST' instead in C:\xampp\htdocs\skrypt.php on line 16
23-10-2013

Ten post edytował adzik511 23.10.2013, 20:14:41
Go to the top of the page
+Quote Post
pedro84
post 23.10.2013, 20:10:41
Post #2





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Ustaw strefę czasową w pliku php.ini.

PS. Kod wstawiamy do odpowiednich tagów.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
adzik511
post 23.10.2013, 20:16:03
Post #3





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 2.06.2013

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


zmieniłem na takie coś :

;date_default_timezone_set ('Europe/Warsaw');

ale nadal nie działa
Go to the top of the page
+Quote Post
pedro84
post 23.10.2013, 20:20:51
Post #4





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Pokaż kod, bo jeśli wstawiłeś to na początku to powinno działać (ten średnik to błąd kopiowania?).


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
adzik511
post 23.10.2013, 20:28:07
Post #5





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 2.06.2013

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


http://pokazywarka.pl/1lv1a3/
Go to the top of the page
+Quote Post
pedro84
post 23.10.2013, 20:37:48
Post #6





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


W pliku php.ini znak średnika oznacza komentarz i masz to poprostu zakomentowane. Usuń średnik i zrestartuj Apacza.


--------------------
Google knows the answer...
Go to the top of the page
+Quote Post
adzik511
post 23.10.2013, 20:40:36
Post #7





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 2.06.2013

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


wszystkie średniki usunąć ?
Go to the top of the page
+Quote Post
pedro84
post 23.10.2013, 20:42:29
Post #8





Grupa: Nieautoryzowani
Postów: 2 249
Pomógł: 305
Dołączył: 2.10.2006

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


Oczywiście, że nie. Zamień to
Kod
;date_default_timezone_set ('Europe/Warsaw');

na to
Kod
date.timezone = Europe/Warsaw


Tę funkcję miałeś wywołać w kodzie, a nie pliku konfiguracyjnym. Eh...


--------------------
Google knows the answer...
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 Wersja Lo-Fi Aktualny czas: 16.07.2025 - 19:42