Page 1 of 1

ISO-8601 week format to Sun-Sat format?

Posted: Fri Sep 01, 2006 11:46 am
by Ward
I'm working on a calendar app, and I need to figure out which week of the year a date is in. However, my calendar works on a Sunday-Saturday basis. The date() function has the 'W' format, which returns the ISO-8601 week number. This format considers a week to be Monday-Sunday. How can I either convert to Sun-Sat, or otherwise find it?

Posted: Fri Sep 01, 2006 1:07 pm
by Ward
Well, I figured it out. In case anyone else was wondering, I used this to calculate the week of year based on a Sunday-Saturday week:

Code: Select all

strftime("%U",$timestamp);