I'm porting some perl (a calendar) over to php and I have some date
questions.
What I'd like to do is feed in a month and year and get the number of
days in the month and the starting day of the week.
The date function does this:
$day_of_week = date('w',$unix_timestamp);
$days_in_month = date('t',$unix_timestamp);
Now, I don't know how to get the timestamp easily.
I thought I could do this:
$date_obj = date_create();
date_date_set($date_obj,$year,$month,1);
But I don't know how to get the timestamp out of the date_obj. What's
the function for that?
Is there an easier way to do this?
Perl is a bit erratic in how it indexes months and years. I didn't see
much in the docs but:
Is the month "1" indexed (ie, January is 1)?
Is the day also 1 index?
Is the year a 4 digit year?
That would be sensible which is not the case in Perl!
Jeff