Yeah - just dumb!. I'd put my date vars into mktime in the european order.
Once I switched them it worked fine.

Chers

George

> -----Original Message-----
> From: George Pitcher [mailto:[EMAIL PROTECTED]
> Sent: 21 June 2003 2:50 pm
> To: [EMAIL PROTECTED]
> Subject: [PHP] Coercing a date calc - problem - or am I just dumb tryin
> g it this way
>
>
> Hi all,
>
> I've just written this function:
>
> $term='Michaelmas';
> function f_week($w,$t)
> {
>       $P=7*($w-1);
>       if( $t == 'Michaelmas'){
>               $D = 06;
>               $M = 10;
>               $Y = 2003;
>       } else {
>               $D = 12;
>               $M = 01;
>               $Y = 2004;
>       }
>       $week=date("d/m/Y", mktime(0,0,0,$D+$P,$M,$Y));
>       return $week;
> }
> ?>
> Michaelmas week 4 is <? echo f_week(4,$term) ?>
>
> But the date it shows is '10/03/2005 ' rather than '03/10/2003'.
>
> Suggestions please.
>
> George in Oxford
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to