Re: Date Increment Problem
| From: | Stephen Edmonds | Date: | Wed, 30 Oct 2002 17:36:07 +0000 |
| Subject: | Re: Date Increment Problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16628@lists.php.net to get a copy of this message | ||
Firstly, you need to understand time.
Time in computers is stored as the number of seconds since January 1st,
1970. The time now is 1035999078 (Or to humans, 17:31:30 on the 30th Oct).
When you call the current time with time() it returns that long number
above. You can then add on 1 days worth of seconds to figure out when
tommorow is
$CurrentTime = time();
$TommorowTime = $CurrentTime + ( 60 * 60 * 24 * 3 );
You can then use date() to transform that number in to human form
$HumanDate = date( d/n/y H:i, $TommorowTime );
print $HumanDate;
Hope this helps
Stephen
----- Original Message -----
From: "Raheel Hussain" <raheelphp@yahoo.com>
To: <php-windows@lists.php.net>
Sent: Wednesday, October 30, 2002 11:04 AM
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