PHP date_date_set() İşlevi
Örnek
Yeni bir DateTime nesnesi döndürün, yeni bir tarih ayarlayın ve ardından tarihi biçimlendirin:
<?php
$date=date_create();
date_date_set($date,2020,10,30);
echo date_format($date,"Y/m/d");
?>
Tanım ve Kullanım
date_date_set() işlevi yeni bir tarih ayarlar.
Sözdizimi
date_date_set(object, year, month, day)
Parametre Değerleri
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
year | Required. Specifies the year of the date |
month | Required. Specifies the month of the date |
day | Required. Specifies the day of the date |
Teknik detaylar
Geri dönüş değeri: | Başarı durumunda yeni bir DateTime nesnesi döndürür. Başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 5.2+ |
PHP Değişiklik Günlüğü: | PHP 5.3: Dönüş değeri NULL'dan DateTime'a değiştirildi (başarılı olduğunda) |
❮ PHP Tarih/Saat Referansı