can't get week of year from date in dd-mm-yyyy format
Posted: Mon May 26, 2008 10:56 am
hi,
i need to list the production of a factory for a certain week, for this the user enters a date, and, from this date, i have to know the production for the week in which that day is.. for instance day 5 is a tuesday, so after the user entered 05-02-2008, i have to find out what day is sunday (before) and saturday (after) so i can list in a sql query between.
i thought to first get to know the week number by using: $week=date('W',strtotime($day));
but this day is passed as dd-mm-yyyy, and php only is accepting yyyy-mm-dd, or it returns nonsense weeks.
can i put it the way i want? how?
this is my problem but, if you already did something like this do you have any suggestion for the "whole" problem?
thanks
i need to list the production of a factory for a certain week, for this the user enters a date, and, from this date, i have to know the production for the week in which that day is.. for instance day 5 is a tuesday, so after the user entered 05-02-2008, i have to find out what day is sunday (before) and saturday (after) so i can list in a sql query between.
i thought to first get to know the week number by using: $week=date('W',strtotime($day));
but this day is passed as dd-mm-yyyy, and php only is accepting yyyy-mm-dd, or it returns nonsense weeks.
can i put it the way i want? how?
this is my problem but, if you already did something like this do you have any suggestion for the "whole" problem?
thanks