Page 1 of 1

date of the first day from a given week number

Posted: Tue Jun 10, 2003 12:56 am
by nickel
Hi peps.

I need some help to figure out the date of the first day in a given week number.
Let's say that I pick week number 23, I want to retrive the day of that monday in week 23..

I've been searching the net for days without any result.
I appreciate every singel answer I get.

signing out; nickel.

Posted: Tue Jun 10, 2003 2:01 am
by deejay
I'd start by having a look at calendar scripts in hotscripts if I were you. http://www.hotscripts.com/PHP/Scripts_a ... index.html . sorry i can't help you more, its not something i've had to do.

Posted: Tue Jun 10, 2003 2:40 am
by []InTeR[]
In most script you will have to give the date, or timestamp to the function.

I have never seen a function that caculates the date or timestampt from a weeknr.

Maybe you can mail php.net to extend the Date and Time functions.

Posted: Tue Jun 10, 2003 10:36 am
by nickel
Well, I was more thinking about write my own function, since is doesn't exist one.

The problem is I don't know where to start.. I've also been looking on some other calendar scripts but could'nt find anything usefull.

Posted: Tue Jun 10, 2003 2:46 pm
by twigletmac
This shouldn't be too tough if you're using timestamps. Using the date() function you can work out what day of the week your date is on and then you can subtract however many days you need to get Monday's timestamp.

Mac