PHP - Accurate Unix timestamp periods without MySql
- by Wonka
I'm trying to have an accurate Unix timestamp values for:
today,
this week,
this month,
this year
There are a few snags however:
- Today should be everything since last midnight
- This week should start on the last/this monday
- This month (should know if its 30/31 days or 28/29 days feb)
- This should be the very beginning of the current year up til now
I want to do this without mysql at all, purely in php as I need it as an accurate Unix timestamp to assign to a variable. Any Idea how these timestamps periods can be calculated?