Timestamp for beginning of the week?
Posted: Wed Sep 03, 2008 6:29 am
Hi
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:
For the Day begin timestamp i have:
But i cant seem to get anything working for the first monday of the week??? Any help? 
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);