Sayfaya tarih ve saat eklemek?
Sayfada şöyle bir kod var.
Kodu kullanan kişide çalışıyor. Bende şöyle hata veriyor.
Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Şu kodu ekledim düzelmedi. ( date_default_timezone_set('Europe/Istanbul'); )
Sorun çözülmüyor. Sayfada tarih ya da saati veya her ikisini birden nasıl gösterebilirim.
Cevaplar(9)
Şöyle hata verdi.
Parse error: syntax error, unexpected ':' in C:\AppServ\www\basit-cms\index.php on line 12
12 satırda şöyle $saat = date(h:i:s);
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Soru içinde yazdım fakat görülmedi. Sayfada kullanılan kod şu echo date("I jS, F Y");
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
@delete Birde aşağıdaki kodu dener misiniz hocam
Yazılım Soru - Kod Kısmı
echo date('d F Y l');
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Sorun düzelmedi. Hata mesajı devam ediyor.
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Bu hatayı gideremiyor isek ekranda tarih ve saati gösteren kodu verebilir misiniz?
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Bu deneyin isterseniz.
Yazılım Soru - Kod Kısmı
<?php
$saat = date(h:i:s)
$tarih = date(d.m.y)
echo"Saat : ".$saat."<br>"
."Tarih İse : ".$tarih."<br>";
?>
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
@kereme 'nin verdiği kodda hata vardı onu düzelttim.Aşağıdaki kodu kullanabilirsiniz.Birde hocam eğer cevap faydalı değilse soruya cevap olarak değil cevaba
@kullanıcıadı şeklinde kişiyi etiketleyerek yorum yapınız.Diğer türlü sorudaki cevaplar gereksiz çoğalıyor.Koda gelirsek;
Yazılım Soru - Kod Kısmı
//Sadece saati çekmek isterseniz burası
echo date("h:i:s")."<br />";
//Sadece tarihi çekmek isterseniz burası
echo date("d.m.y")."<br />";
//Her ikisinide çekmek istersenizde burası
echo date("h:i:s d.m.y");
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
hata kodu ekranda görünmeye devam ediyor.
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Sorun çözüldü.
date_default_timezone_set (GMT);
Bu kod eklendiğinde default zaman biçimi belirtilirse hata gidiyor.
Beğen (0)
Yorumlar(0)
Yorum Yaz
Gönder
Cevap yazabilmek için Giriş yapmalısınız.Giriş yapmak için buraya Tıklayın.