[PHP] strtotime Question

2004-01-27 Thread gohaku
Hi everyone,
I made the mistake of using strtotime(day) instead of 
strtotime(today)
to get the current time.
I was just curious, what is strtotime(day) represent?

Below is what I used to test the day and today parameters:

Testing One Minute Differencebr
?
echo min_diff();
function min_diff()
{
$now = strtotime(today);//Return value is 60
//$now = strtotime(day);//Return value is 86400
$onemin = strtotime(-1 minute);
return $now-$onemin;
}
?
Thanks in advance.
-Gohaku

Re: [PHP] strtotime Question

2004-01-27 Thread - Edwin -
Hi,

On Tue, 27 Jan 2004 23:05:09 -0500
gohaku [EMAIL PROTECTED] wrote:

 Hi everyone,
 I made the mistake of using strtotime(day) instead of 
 strtotime(today)
 to get the current time.
 I was just curious, what is strtotime(day) represent?
 
 Below is what I used to test the day and today parameters:
 
 Testing One Minute Differencebr
 ?
 echo min_diff();
 function min_diff()
 {
   $now = strtotime(today);//Return value is 60
   //$now = strtotime(day);//Return value is 86400
   $onemin = strtotime(-1 minute);
   return $now-$onemin;
 }
 ?

60 seconds * 60 min. * 24 hrs. = 86400?

--

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



[PHP] strtotime() question

2003-09-14 Thread Kyle Bisignani
Hello,
I'm not even quite sure if I am posting this message in the right place,
so please bear with me.
I have a question regarding the strtotime() function.  I am developing a PHP
script to handle dates for my web site, and I need an easy way to get from
today to tomorrow to +2 days to +3 days... you get the idea... all the way
up to +90 days.  The strtotime() function seems ideal because the script can
easily put in +51 days and it knows what to do.
My question is how does it handle Daylight Savings Time?  The program I
was previously using (written in Perl) actually jumped a day or duplicated a
day when DST was coming up or ending.  When using the +19 days syntax in
the strtotime() function, does it take into account DST and not cause
similar problems?

Thank you very much for any help.
~Kyle Bisignani

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



Re: [PHP] strtotime question

2001-03-09 Thread Richard Lynch

0 is Sunday, 1 is Monday, 2 is Tuesday, ...

-- 
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message - 
From: Jason Murray [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Tuesday, March 06, 2001 12:06 PM
Subject: [PHP] strtotime question


 Hi there,
 
 $ob-date is '2000/03/06'.
 
 $d = ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)',
   '\2/\3/\1', $ob-date);
 
 $d is now '03/06/2000'.
 
 $foo = getdate(strtotime($d)+86400);
 
 Here I have to add an entire day to the value of strtotime($d) to get
 the expected results for below.
 
 echo "P" . $foo["weekday"] . ", " . $d . "blockquote\n";
 
 Without adding a day to strtotime() $foo["weekday"] is 'Monday'.
 
 Is there some kind of timezone stuff I am not accounting for? or is it
 something else?
 
 Thanks,
 Jason
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] strtotime question

2001-03-06 Thread Jason Murray

Hi there,

$ob-date is '2000/03/06'.

$d = ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)',
  '\2/\3/\1', $ob-date);

$d is now '03/06/2000'.

$foo = getdate(strtotime($d)+86400);

Here I have to add an entire day to the value of strtotime($d) to get
the expected results for below.

echo "P" . $foo["weekday"] . ", " . $d . "blockquote\n";

Without adding a day to strtotime() $foo["weekday"] is 'Monday'.

Is there some kind of timezone stuff I am not accounting for? or is it
something else?

Thanks,
Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]