Re: Date Increment Problem

From: Date: Thu, 31 Oct 2002 13:59:29 +0000
Subject: Re: Date Increment Problem
References: 1 2 3  Groups: php.windows 
Request: Send a blank email to php-windows+get-16633@lists.php.net to get a copy of this message
60 seconds in an minute 60 minutes in an hour 24 hours in a day 3 days needed therefor: 60 * 60 * 24 * 3 Its worth noting there are 3600 seconds in 1 hour... so you could use 3600 * 24 * 3 ----- Original Message ----- From: "Constantin Baciu" <johndoe110479@mymail.ro> To: "Stephen Edmonds" <stephen.edmonds5@btinternet.com> Sent: Thursday, October 31, 2002 8:07 AM Subject: Re: [PHP-WIN] Date Increment Problem > Correct me if I am wrong, but I think that the seconds in 3 days are 60*24*3 > (as opposed to 60*60*24*3) > > ----- Original Message ----- > From: "Stephen Edmonds" <stephen.edmonds5@btinternet.com> > Newsgroups: php.windows > To: "PHP Helplist Windows" <php-windows@lists.php.net>; "Raheel > Hussain" > <raheelphp@yahoo.com> > Sent: Wednesday, October 30, 2002 7:36 PM > Subject: Re: [PHP-WIN] Date Increment Problem > > > > 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 > > > > > > > ------------------------------------------------------------------------ > P.S. Stiai ca s-a lansat www.FreeSMS.ro ? >

« previous php.windows (#16633) next »