#28209 [Com]: strtotime(now)

2004-09-01 Thread tony at marston-home dot demon dot co dot uk
 ID:   28209
 Comment by:   tony at marston-home dot demon dot co dot uk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

Until this behaviour is fixed so that now() means 'real now' and not
'GNU now' here is a workaround that works in both PHP 4 and PHP 5:

$real_now = date('Y-m-d H:i:s');
$dt1 = strtotime($real_now -1 day);
$dt2 = date('Y-m-d H:i:s', $dt1);


Previous Comments:


[2004-07-15 09:21:31] kilnight at hotmail dot com

I've been using strtotime() to calculate relative shifts in time, ie.

$real_now = strtotime(2004-07-15 00:16:35);
$exactly_one_day_ago = strtotime(-1 day, $real_now);
echo date('Y-m-d H:i:s', $exactly_one_day_ago)

Expecting 2004-07-14 00:16:35
but getting: 2004-07-14 00:00:00

I'm sure there's a way around this, but I'm really not that bright...
so I had to jump back to php4 for the time being.

So I also think that the now parameter should be real now, not GNU
now.



[2004-07-12 21:50:07] patchwork14 at hotmail dot com

Will this bug be fixed before the final php5 release?

A lot of code will need rewriting before php5 is released if now is
going to changed.

Wouldn't it be better to have

today = Monday 12th of July 2004 12:00:00 AM
now   = Monday 12th of July 2004 08:49:23 PM



[2004-07-05 11:13:44] niels dot hansen at pola dot dk

The functionality is maintained in RC3. 
I needs the realtime for logging of process. My workaround is to do
this:
$str=date('d F Y h:i:s A');
$timestamp = strtotime($str);



[2004-06-15 12:42:47] wb at pro-net dot co dot uk

So how would one, for example, use strtotime() to get the current time
+ 10 mins?



[2004-05-19 12:33:35] [EMAIL PROTECTED]

That's feasible for the rewrite, but for the current parser.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28209

-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-07-15 Thread kilnight at hotmail dot com
 ID:   28209
 Comment by:   kilnight at hotmail dot com
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

I've been using strtotime() to calculate relative shifts in time, ie.

$real_now = strtotime(2004-07-15 00:16:35);
$exactly_one_day_ago = strtotime(-1 day, $real_now);
echo date('Y-m-d H:i:s', $exactly_one_day_ago)

Expecting 2004-07-14 00:16:35
but getting: 2004-07-14 00:00:00

I'm sure there's a way around this, but I'm really not that bright...
so I had to jump back to php4 for the time being.

So I also think that the now parameter should be real now, not GNU
now.


Previous Comments:


[2004-07-12 21:50:07] patchwork14 at hotmail dot com

Will this bug be fixed before the final php5 release?

A lot of code will need rewriting before php5 is released if now is
going to changed.

Wouldn't it be better to have

today = Monday 12th of July 2004 12:00:00 AM
now   = Monday 12th of July 2004 08:49:23 PM



[2004-07-05 11:13:44] niels dot hansen at pola dot dk

The functionality is maintained in RC3. 
I needs the realtime for logging of process. My workaround is to do
this:
$str=date('d F Y h:i:s A');
$timestamp = strtotime($str);



[2004-06-15 12:42:47] wb at pro-net dot co dot uk

So how would one, for example, use strtotime() to get the current time
+ 10 mins?



[2004-05-19 12:33:35] [EMAIL PROTECTED]

That's feasible for the rewrite, but for the current parser.



[2004-05-19 12:10:35] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28209

-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-07-12 Thread patchwork14 at hotmail dot com
 ID:   28209
 Comment by:   patchwork14 at hotmail dot com
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

Will this bug be fixed before the final php5 release?

A lot of code will need rewriting before php5 is released if now is
going to changed.

Wouldn't it be better to have

today = Monday 12th of July 2004 12:00:00 AM
now   = Monday 12th of July 2004 08:49:23 PM


Previous Comments:


[2004-07-05 11:13:44] niels dot hansen at pola dot dk

The functionality is maintained in RC3. 
I needs the realtime for logging of process. My workaround is to do
this:
$str=date('d F Y h:i:s A');
$timestamp = strtotime($str);



[2004-06-15 12:42:47] wb at pro-net dot co dot uk

So how would one, for example, use strtotime() to get the current time
+ 10 mins?



[2004-05-19 12:33:35] [EMAIL PROTECTED]

That's feasible for the rewrite, but for the current parser.



[2004-05-19 12:10:35] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:10:17] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28209

-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-07-05 Thread niels dot hansen at pola dot dk
 ID:   28209
 Comment by:   niels dot hansen at pola dot dk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

The functionality is maintained in RC3. 
I needs the realtime for logging of process. My workaround is to do
this:
$str=date('d F Y h:i:s A');
$timestamp = strtotime($str);


Previous Comments:


[2004-06-15 12:42:47] wb at pro-net dot co dot uk

So how would one, for example, use strtotime() to get the current time
+ 10 mins?



[2004-05-19 12:33:35] [EMAIL PROTECTED]

That's feasible for the rewrite, but for the current parser.



[2004-05-19 12:10:35] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:10:17] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:04:25] wb at pro-net dot co dot uk

Hi derick,

Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

Something like:

int strtotime ( string time [, int now] [, bool gnu = false])



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28209

-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-06-15 Thread wb at pro-net dot co dot uk
 ID:   28209
 Comment by:   wb at pro-net dot co dot uk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

So how would one, for example, use strtotime() to get the current time
+ 10 mins?


Previous Comments:


[2004-05-19 12:33:35] [EMAIL PROTECTED]

That's feasible for the rewrite, but for the current parser.



[2004-05-19 12:10:35] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:10:17] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:04:25] wb at pro-net dot co dot uk

Hi derick,

Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

Something like:

int strtotime ( string time [, int now] [, bool gnu = false])



[2004-05-18 21:53:44] [EMAIL PROTECTED]

This is actually expected behavior because we follow the GNU guidelines
here, but I agree it's a weird thing to do. If nobody objects I'll make
now be really now during the rewrite of the strtotime() rewrite.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28209

-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-05-19 Thread wb at pro-net dot co dot uk
 ID:   28209
 Comment by:   wb at pro-net dot co dot uk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

Hi derick,

Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

Something like:

int strtotime ( string time [, int now] [, bool gnu = false])


Previous Comments:


[2004-05-18 21:53:44] [EMAIL PROTECTED]

This is actually expected behavior because we follow the GNU guidelines
here, but I agree it's a weird thing to do. If nobody objects I'll make
now be really now during the rewrite of the strtotime() rewrite.



[2004-05-18 12:28:09] wb at pro-net dot co dot uk

Im seeing the same thing on FreeBSD 5 with PHP5 rc2.

code: 

?php
$strtime = strtotime('now');
printf('
 Now:  %11s  %s
Str time:  %11s  %s

'
, time()
, date('d M Y @ H:i:s ')
, $strtime
, date('d M Y @ H:i:s ', $strtime)
);
?

Expected:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084875653  18 May 2004 @ 11:20:53


Actual:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084834800  18 May 2004 @ 00:00:00



[2004-04-28 21:06:33] gamin at centras dot lt

Description:

Simple script... doesn't matter how much time i run it -
strototime(now) produces same result for whole day. On next month day
it produces same result. Seems i didn't have any problem on RC1.

Reproduce code:
---
$str = now;
$timestamp = strtotime($str);
echo $str ==  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;
$timestamp = time();
echo Good is  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;


Expected result:

now == Wednesday 28th of April 2004 10:02:54 PM
Good is Wednesday 28th of April 2004 10:02:54 PM

Actual result:
--
now == Wednesday 28th of April 2004 12:00:00 AM
Good is Wednesday 28th of April 2004 10:02:54 PM





-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-05-19 Thread wb at pro-net dot co dot uk
 ID:   28209
 Comment by:   wb at pro-net dot co dot uk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.


Previous Comments:


[2004-05-19 12:10:17] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:04:25] wb at pro-net dot co dot uk

Hi derick,

Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

Something like:

int strtotime ( string time [, int now] [, bool gnu = false])



[2004-05-18 21:53:44] [EMAIL PROTECTED]

This is actually expected behavior because we follow the GNU guidelines
here, but I agree it's a weird thing to do. If nobody objects I'll make
now be really now during the rewrite of the strtotime() rewrite.



[2004-05-18 12:28:09] wb at pro-net dot co dot uk

Im seeing the same thing on FreeBSD 5 with PHP5 rc2.

code: 

?php
$strtime = strtotime('now');
printf('
 Now:  %11s  %s
Str time:  %11s  %s

'
, time()
, date('d M Y @ H:i:s ')
, $strtime
, date('d M Y @ H:i:s ', $strtime)
);
?

Expected:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084875653  18 May 2004 @ 11:20:53


Actual:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084834800  18 May 2004 @ 00:00:00



[2004-04-28 21:06:33] gamin at centras dot lt

Description:

Simple script... doesn't matter how much time i run it -
strototime(now) produces same result for whole day. On next month day
it produces same result. Seems i didn't have any problem on RC1.

Reproduce code:
---
$str = now;
$timestamp = strtotime($str);
echo $str ==  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;
$timestamp = time();
echo Good is  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;


Expected result:

now == Wednesday 28th of April 2004 10:02:54 PM
Good is Wednesday 28th of April 2004 10:02:54 PM

Actual result:
--
now == Wednesday 28th of April 2004 12:00:00 AM
Good is Wednesday 28th of April 2004 10:02:54 PM





-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1


#28209 [Com]: strtotime(now)

2004-05-19 Thread wb at pro-net dot co dot uk
 ID:   28209
 Comment by:   wb at pro-net dot co dot uk
 Reported By:  gamin at centras dot lt
 Status:   Assigned
 Bug Type: Date/time related
 Operating System: WinXP HE SP1
 PHP Version:  5.0.0RC2
 Assigned To:  derick
 New Comment:

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.


Previous Comments:


[2004-05-19 12:10:17] wb at pro-net dot co dot uk

Just thought that i would point out that in PHP 4 now is real now and
not GNU now so form a BC point of view i think now should be real now.



[2004-05-19 12:04:25] wb at pro-net dot co dot uk

Hi derick,

Yes that is strange, What about adding an optional parameter to the
function to set toggle between real now and gnu now?

Something like:

int strtotime ( string time [, int now] [, bool gnu = false])



[2004-05-18 21:53:44] [EMAIL PROTECTED]

This is actually expected behavior because we follow the GNU guidelines
here, but I agree it's a weird thing to do. If nobody objects I'll make
now be really now during the rewrite of the strtotime() rewrite.



[2004-05-18 12:28:09] wb at pro-net dot co dot uk

Im seeing the same thing on FreeBSD 5 with PHP5 rc2.

code: 

?php
$strtime = strtotime('now');
printf('
 Now:  %11s  %s
Str time:  %11s  %s

'
, time()
, date('d M Y @ H:i:s ')
, $strtime
, date('d M Y @ H:i:s ', $strtime)
);
?

Expected:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084875653  18 May 2004 @ 11:20:53


Actual:


 Now:   1084875653  18 May 2004 @ 11:20:53
Str time:   1084834800  18 May 2004 @ 00:00:00



[2004-04-28 21:06:33] gamin at centras dot lt

Description:

Simple script... doesn't matter how much time i run it -
strototime(now) produces same result for whole day. On next month day
it produces same result. Seems i didn't have any problem on RC1.

Reproduce code:
---
$str = now;
$timestamp = strtotime($str);
echo $str ==  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;
$timestamp = time();
echo Good is  . date('l dS of F Y h:i:s A', $timestamp) . br
/\n;


Expected result:

now == Wednesday 28th of April 2004 10:02:54 PM
Good is Wednesday 28th of April 2004 10:02:54 PM

Actual result:
--
now == Wednesday 28th of April 2004 12:00:00 AM
Good is Wednesday 28th of April 2004 10:02:54 PM





-- 
Edit this bug report at http://bugs.php.net/?id=28209edit=1