Conevert date a week number

Hi,
I need to convert a date to its equivalent in a week.
Can you help
Thanks a lot.
Fabi?n

Re: Conevert date a week number

http://php.net/manual/en/ref.datetime.php

Regards,
Scott.

Re: Conevert date a week number

$dia= date(‘d’,{fecha_salida_puerto});
$mes=date(‘m’,{fecha_salida_puerto});
$ano=date(‘Y’,{fecha_salida_puerto});

$week_of_year= date(‘W’, mktime(0,0,0,$mes,$dia,$ano));

need to know if this structure is correct.

I do not deliver the required value.

Thanks a lot,
Fabi?n

Re: Conevert date a week number

It would help if you would display the result you are getting vs the value you are expecting.

The structure seems correct

It is also known that dealing with weeks can get tricky due to changes in the calendar. Have a look at:
http://psoug.org/snippet.htm/Get_week_number_394.htm?PHPSESSID=38d13329555097e16c1adfed9ad56050
http://www.codingforums.com/archive/index.php/t-92051.html
http://www.phpfreaks.com/forums/index.php?topic=231118.0
http://www.webmasterworld.com/php/3643495.htm

Regards,
Scott.