RE: [PHP] Coercing a date calc - problem - or am I just dumb tryin g it this way SOLVED
| From: | George Pitcher | Date: | Sat, 21 Jun 2003 14:16:00 +0000 |
| Subject: | RE: [PHP] Coercing a date calc - problem - or am I just dumb tryin g it this way SOLVED | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152392@lists.php.net to get a copy of this message | ||
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:george.pitcher@ingenta.com]
> Sent: 21 June 2003 2:50 pm
> To: php-general@lists.php.net
> 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
>
>