Hızlı yardım php damgaları ile çalışma

2 Cevap

Ben bir takvim uygulaması üzerinde çalışıyorum ve her gün / ay vb başlangıcı için damgaları almak gerekiyor ediyorum:

nedir en iyi yöntem?

//get timestamps for start of (day, month, year)
$ts_now         = time();
$ts_today      = 
$ts_this_month  =
$ts_this_year   =

2 Cevap

$ts_today       = mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) );
$ts_this_month  = mktime( 0, 0, 0, date( 'm' ), 0, date( 'Y' ) );
$ts_this_year   = mktime( 0, 0, 0, 0, 0, date( 'Y' ) );

Sanırım ...