Can please somebody help me with this piece of code.
I need to determine 3 things, 1 the duration in seconds from the beginning of the month to the current time, beginning of the week to current time and then beginning of the day to the current time.
So first i need to determine the begin timestamp for each.
Now i have the following:
For the month begin timestamp i have:
Code: Select all
$date_today = date("Y-m-d", time());
list($year_cur, $month_cur, $day1) = split('-', $date_today);
$month_start_cur = gmmktime (0,0,0, $month_cur, 1, $year_cur);Code: Select all
$date_today = date("Y-m-d", time());
list($year_cur, $month_cur, $day1) = split('-', $date_today);
$day_start_cur = gmmktime (0,0,0, $month_cur, $day1, $year_cur);