raheel
The method Constantin suggests is a good solution for your problem, but also
have a thorough read of the manual under date functions, there is a lot of
additional useful info there with the use of several of the functions in
unison - for example...

$tomorrow  = mktime (0,0,0,date("m")  ,date("d")+1,date("Y"));
$lastmonth = mktime (0,0,0,date("m")-1,date("d"),  date("Y"));
$nextyear  = mktime (0,0,0,date("m"),  date("d"),  date("Y")+1);

(taken straight from the manual) -
then you will be able to write some handy little functions of your own to do
a lot of these common tasks easily.

A lot of the scripts you write will probably require frequent manipulation
and calculation of date info, expressed as timestamps, user friendly dates,
mysql "datetime" type fields and so on and if you don`t streamline these
jobs sooner rather than later they will drive you nuts.

Time spent now studying the manual and playing with these date functions
will be well spent believe me.  Writing a simple calender program is a good
way to get used to the sometimes tricky date issues, leap years, 29th
Feburary, "tomorrow, "next week", "6 months time"  etc etc etc.

cheers and good luck, CD


----- Original Message -----
From: "Raheel Hussain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 10:04 PM
Subject: [PHP-WIN] Date Increment Problem


>
> hi, I m a newbie programmer, may b solve to this prob. is a cheap thing,
but i cant get solution of it.
>
> i have two variables
> $RegisterDate, and $ExpireDate
>
> what I want to do is the the $RegisterDate will be taken from the system.
> but the $ExpireDate will be three days after the $RegisterDate,
>
> i m doing this in the following way, but having problems, i cant find the
way to increment the data for after three days
>
> $RegisterDate=date("m/d/y");
> $ExpireDate=$RegisterDate + 3 //creating problem,
>
> if the register date is 10/29/01 then the expire date should be 11/2/02.
>
> plz help
>
>
>
> ---------------------------------
> Do you Yahoo!?
> HotJobs - Search new jobs daily now


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

Reply via email to