$now=date(Y-m-d);
A = $mydata-birthday = 1928-02-12;
B = $mydata-birthday = 1965-03-18;
C = $mydata-birthday = 1976-04-11;
I'm doing a demographic sort.
How do I calculate whether $mydata-Birthday falls into these categories
below?
I'm working my way right now through the manual:
On my home machine running 5.3.2-2 in debian linux the commands:
echo date('Y-m-d',strtotime('first day of this month')).'br/';
echo date('Y-m-d',strtotime('last day of next month'));
give the expected results.
I just got setup with a hosting provider running 5.2.13 on BSD and both
give
On Mon, 2010-08-23 at 16:04 -0400, Rick Pasotto wrote:
On my home machine running 5.3.2-2 in debian linux the commands:
echo date('Y-m-d',strtotime('first day of this month')).'br/';
echo date('Y-m-d',strtotime('last day of next month'));
give the expected results.
I just got setup
On Mon, Aug 23, 2010 at 17:02, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
The example you quote as being straight from the manual page is actually
from the user-submitted code snippets, and I can't find the
documentation to support it. I can only assume that it's possibly an
On Mon, Aug 23, 2010 at 05:57:28PM -0400, Daniel Brown wrote:
On Mon, Aug 23, 2010 at 17:02, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
The example you quote as being straight from the manual page is actually
from the user-submitted code snippets, and I can't find the
On Mon, Aug 23, 2010 at 22:27, Rick Pasotto r...@niof.net wrote:
After I sent my original post the one and only user comment on the
relative date strings man page was pointed out to me. So, it's there but
how many people make a habit of reading all the user comments?
A few thousand per
On Mon, Aug 23, 2010 at 11:38:41PM -0400, Daniel P. Brown wrote:
On Mon, Aug 23, 2010 at 22:27, Rick Pasotto r...@niof.net wrote:
After I sent my original post the one and only user comment on the
relative date strings man page was pointed out to me. So, it's there but
how many people
On Tue, Aug 24, 2010 at 00:37, Rick Pasotto r...@niof.net wrote:
http://us2.php.net/manual/en/datetime.formats.relative.php
Thank you, sir!
--
/Daniel P. Brown
UNADVERTISED DEDICATED SERVER SPECIALS
SAME-DAY SETUP
Just ask me what we're offering today!
daniel.br...@parasane.net ||
Hello all.
Long time no see! Anyway, I'm having an issue with strtotime(). Why do the
following return valid timestamps?
?php
echo strtotime ('a').': '.date (m/d/Y, strtotime ('a')).br/;
echo strtotime ('a,a').': '.date (m/d/Y, strtotime ('a,a')).br/;
echo strtotime ('a,a,a').': '.date (m/d/Y,
On 5 May 2010 16:58, Philip Thompson philthath...@gmail.com wrote:
Hello all.
Long time no see! Anyway, I'm having an issue with strtotime(). Why do the
following return valid timestamps?
?php
echo strtotime ('a').': '.date (m/d/Y, strtotime ('a')).br/;
echo strtotime ('a,a').': '.date
On May 5, 2010, at 10:12 AM, Peter Lind wrote:
On 5 May 2010 16:58, Philip Thompson philthath...@gmail.com wrote:
Hello all.
Long time no see! Anyway, I'm having an issue with strtotime(). Why do the
following return valid timestamps?
?php
echo strtotime ('a').': '.date (m/d/Y,
: Thursday, January 14, 2010 4:14 PM
To: php-general@lists.php.net
Subject: Re: [PHP] strtotime
On Thu, Jan 14, 2010 at 2:53 PM, Adam Richardson
simples...@gmail.comwrote:
I've not read this, but if the first valid date is Jan. 1st, 1970,
then
passing that date back in the case of errors would lead
Hello,
In a mysql date() field, I set the default to -00-00.
Therefore, $mydata-birthday = -00-00;
But when I run this next line, $then = 1969.
$then=date(Y, strtotime($mydata-birthday));
Why 1969, and not 0 or nothing?
If I echo strtotime(-00-00);
Nothing appears. So $then
On Thu, 2010-01-14 at 13:14 -0500, John Taylor-Johnston wrote:
Hello,
In a mysql date() field, I set the default to -00-00.
Therefore, $mydata-birthday = -00-00;
But when I run this next line, $then = 1969.
$then=date(Y, strtotime($mydata-birthday));
Why 1969, and not 0 or
When you set the date to -00-00, you start the following sequence:
1. strtotime returns false, because -00-00 isn't a date it can
parse into a timestamp.
2. date returns 1969, because it's not passed a valid timestamp and it
works from December 31, 1969 for any invalid date.
Hi guys
I have a question:
snip
Ashley Sheridan wrote on 14/01/2010 19:20:
MySQL uses a default -00-00 value for date fields generally, but
when converted into a timestamp, the string equates to a false value. In
PHP, timestamps are numerical values indicating the seconds since
Midnight of
I've not read this, but if the first valid date is Jan. 1st, 1970, then
passing that date back in the case of errors would lead to ambiguity. Is it
a valid date or is it an error. Passing back the date of the day just
before (in terms of time, I think it's the second before) the first valid
date
On Thu, Jan 14, 2010 at 2:53 PM, Adam Richardson simples...@gmail.comwrote:
I've not read this, but if the first valid date is Jan. 1st, 1970, then
passing that date back in the case of errors would lead to ambiguity. Is
it
a valid date or is it an error. Passing back the date of the day
My thanks to all!
Adam Richardson wrote:
I've not read this, but if the first valid date is Jan. 1st, 1970,
then passing that date back in the case of errors would lead to
ambiguity. Is it a valid date or is it an error. Passing back the
date of the day just before (in terms of time, I
On 24/12/09 16:59, Bastien Koert wrote:
On Thu, Dec 24, 2009 at 9:12 AM, teddtedd.sperl...@gmail.com wrote:
At 10:20 PM +1000 12/24/09, Angus Mann wrote:
Hi all. I need to allow users to enter dates and times, and for a while
now I've been forcing them to use javascript date/time pickers so
Hi all. I need to allow users to enter dates and times, and for a while now
I've been forcing them to use javascript date/time pickers so I can be
absolutely sure the formatting is correct.
Some users are requesting to be able to type the entries themselves so I've
decided to allow this.
I'm
On Thu, Dec 24, 2009 at 13:20, Angus Mann angusm...@pobox.com wrote:
Hi all. I need to allow users to enter dates and times, and for a while now
I've been forcing them to use javascript date/time pickers so I can be
absolutely sure the formatting is correct.
Some users are requesting to be
At 10:20 PM +1000 12/24/09, Angus Mann wrote:
Hi all. I need to allow users to enter dates and times, and for a
while now I've been forcing them to use javascript date/time pickers
so I can be absolutely sure the formatting is correct.
Some users are requesting to be able to type the entries
On Thu, Dec 24, 2009 at 9:12 AM, tedd tedd.sperl...@gmail.com wrote:
At 10:20 PM +1000 12/24/09, Angus Mann wrote:
Hi all. I need to allow users to enter dates and times, and for a while
now I've been forcing them to use javascript date/time pickers so I can be
absolutely sure the formatting
On Sun, Oct 4, 2009 at 17:00, Floyd Resler fres...@adex-intl.com wrote:
Sorry to hear that! I live in Cincinnati so I normally don't get to watch
the Colts play when they are on at the same time as the Bengals. But this
week I did and, best of all, they won!
Yeah, well, the Browns sure
For some reason the strtotime is no longer returning the year
portion. For example, strtotime(10/04/2009) will result in a date
of -10-04. This started happening recently and I haven't done any
updates other than the normal OS updates. I am running Mac OS X
10.5.8. Does anyone have
Did the OS update changed the default locale settings or the default date
format?
From: fres...@adex-intl.com
To: php-general@lists.php.net
Date: Sun, 4 Oct 2009 14:05:05 -0400
Subject: [PHP] strtotime strangeness
For some reason the strtotime is no longer returning the year
portion
@lists.php.net
Date: Sun, 4 Oct 2009 14:05:05 -0400
Subject: [PHP] strtotime strangeness
For some reason the strtotime is no longer returning the year
portion. For example, strtotime(10/04/2009) will result in a date
of -10-04. This started happening recently and I haven't done
any
updates
- Original Message
From: Floyd Resler fres...@adex-intl.com
To: Andrea Giammarchi an_...@hotmail.com
Cc: php-general@lists.php.net
Sent: Sun, October 4, 2009 12:01:30 PM
Subject: Re: [PHP] strtotime strangeness
I couldn't find anything in the php.ini file to account for this. I
-general@lists.php.net
Sent: Sun, October 4, 2009 12:01:30 PM
Subject: Re: [PHP] strtotime strangeness
I couldn't find anything in the php.ini file to account for this.
I am running
PHP 5.2.10. I've never actually updated it myself so the software
updater
updated it at some point. I did
On Sun, Oct 4, 2009 at 3:22 PM, Floyd Resler fres...@adex-intl.com wrote:
Yeah, the ;Y was a typo in my email. That's what happens while trying to
type while watching my Colts play!
Thanks!
Floyd
Go Colts!
At least you get to watch it, I have to follow along on sports sites!
--
PHP
Sorry to hear that! I live in Cincinnati so I normally don't get to
watch the Colts play when they are on at the same time as the
Bengals. But this week I did and, best of all, they won!
On Oct 4, 2009, at 3:24 PM, Eddie Drapkin wrote:
On Sun, Oct 4, 2009 at 3:22 PM, Floyd Resler
Avec la version 4 de php, strtotime(20080950) fonctionne correctement en
allant sur le mois d'octobre, alors qu'en version 5: 19700101.
Merci de votre aide
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Greetings, Thodoris.
In reply to Your message dated Wednesday, October 8, 2008, 16:35:40,
From your function name I assume you want to use it in MySQL. In that
case, why don't you have MySQL do all the magic for you?
eg. INSERT INTO table (col) VALUES (FROM_UNIXTIME($timestamp));
(using
Greetings, Thodoris.
In reply to Your message dated Wednesday, October 8, 2008, 16:35:40,
Greetings to you too :-) .
From your function name I assume you want to use it in MySQL. In that
case, why don't you have MySQL do all the magic for you?
eg. INSERT INTO table (col) VALUES
I know that *strtotime*() only recognises the formats mm/dd/, -mm-dd and mmdd
for numeric months but I need do something like that:
function dateWebToMysql($webdate){
$format = 'Y-m-d';
$timestamp = strtotime($webdate);
return date($format,$timestamp);
On Oct 8, 2008, at 7:08 AM, Thodoris wrote:
I know that *strtotime*() only recognises the formats mm/dd/,
-mm-dd and mmdd
for numeric months but I need do something like that:
function dateWebToMysql($webdate){
$format = 'Y-m-d';
$timestamp = strtotime($webdate);
On 8 Oct 2008, at 12:58, Thodoris wrote:
Actually this means that strtotime() was made with Americans *only*
in mind... :-) .
As far as I know it uses the configured timezone to decide between
ambiguous formats.
-Stut
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
On Oct 8, 2008, at 7:58 AM, Thodoris wrote:
Actually strtotime accepts all kinds of things... Last week
Thursday midnight for example works perfectly.
You could do an explode on the field and then reorder the array
anyway that you want...
?PHP
$date = 13/01/2008;
$datearray =
Thodoris wrote:
Actually strtotime accepts all kinds of things... Last week
Thursday midnight for example works perfectly.
You could do an explode on the field and then reorder the array
anyway that you want...
?PHP
$date = 13/01/2008;
$datearray = explode(/, $date);
echo
From your function name I assume you want to use it in MySQL. In that
case, why don't you have MySQL do all the magic for you?
eg. INSERT INTO table (col) VALUES (FROM_UNIXTIME($timestamp));
(using FROM_UNIXTIME($timestamp) will give you the date-time in mysql
format (-MM-DD HH:MM:SS)
Actually strtotime accepts all kinds of things... Last week
Thursday midnight for example works perfectly.
You could do an explode on the field and then reorder the array
anyway that you want...
?PHP
$date = 13/01/2008;
$datearray = explode(/, $date);
echo $datearray[1] ./.
On Oct 8, 2008, at 7:08 AM, Thodoris wrote:
I know that *strtotime*() only recognises the formats mm/dd/,
-mm-dd and mmdd
for numeric months but I need do something like that:
function dateWebToMysql($webdate){
$format = 'Y-m-d';
$timestamp =
On Oct 8, 2008, at 7:24 AM, Thodoris wrote:
On Oct 8, 2008, at 7:08 AM, Thodoris wrote:
I know that *strtotime*() only recognises the formats mm/dd/,
-mm-dd and mmdd
for numeric months but I need do something like that:
function dateWebToMysql($webdate){
$format =
At 10:43 AM -0500 3/12/08, Greg Donald wrote:
No matter where we draw the borders or put the roads and highways,
it's still just the one planet, with the same finite resources we all
have to share. Being mad about globalization is pointless, it's
inevitable.
Not if you don't live on this
On Thu, 2008-03-13 at 11:49 -0400, tedd wrote:
At 10:43 AM -0500 3/12/08, Greg Donald wrote:
No matter where we draw the borders or put the roads and highways,
it's still just the one planet, with the same finite resources we all
have to share. Being mad about globalization is pointless,
On 3/13/08, tedd [EMAIL PROTECTED] wrote:
At 10:43 AM -0500 3/12/08, Greg Donald wrote:
No matter where we draw the borders or put the roads and highways,
it's still just the one planet, with the same finite resources we all
have to share. Being mad about globalization is pointless, it's
On 3/10/08, Wolf [EMAIL PROTECTED] wrote:
Watch throwing that blame around there Greg, you get to thank the
democrats for NAFTA and the hurting the heartlands
No matter where we draw the borders or put the roads and highways,
it's still just the one planet, with the same finite resources we
Hey Rob,
Remember on 2007-09-18 at 22:45:37 when you suggested I do this:
http://marc.info/?l=php-generalm=119015558426248w=2
Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to
say that I nearly fell out of my chair laughing when I realized what
the problem was, who caused
Greg Donald wrote:
Hey Rob,
Remember on 2007-09-18 at 22:45:37 when you suggested I do this:
http://marc.info/?l=php-generalm=119015558426248w=2
Well.. today strtotime( 'last Sunday' ) screwed me and I'm writing to
say that I nearly fell out of my chair laughing when I realized what
the
I would use date and mktime, personally, as strtotime often does
things I consider strange
On Sun, February 10, 2008 5:46 am, Ron Piggott wrote:
I am trying to calculate what was the date 18 months ago. When I give
the command:
$18_months_ago = strtotime(-18 months);
It comes back with:
I am trying to calculate what was the date 18 months ago. When I give
the command:
$18_months_ago = strtotime(-18 months);
It comes back with:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE
How would you calculate 18 months ago from today?
Ron
--
PHP General Mailing
Ron Piggott wrote:
I am trying to calculate what was the date 18 months ago. When I give
the command:
$18_months_ago = strtotime(-18 months);
It comes back with:
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE
That's a plain syntactical error, it's not related
I figured out what went wrong. Ron
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 2/10/08, Ron Piggott [EMAIL PROTECTED] wrote:
I figured out what went wrong. Ron
Care to share it with us?
Floor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The date value I was assigning was for a mySQL query ... a date range
query. I was running my query when I hadn't assigned a date to the
other date range variable. I didn't realized I hadn't copied my DATE()
syntax to this area of my code. Ron
On Sun, 2008-02-10 at 18:22 +0100, Floor Terra
I have been using:
$nextSaturday= date(m/d/Y,strtotime(next saturday));
For months long time now with out problems, but in the last two days, it
went kind of funky. It is now returning:
02/09/2008 instead of the expected 02/02/2008. I have tried the same code
on another server and different
Ya - the other server is 4.4.7
However - this does not seem to be the problem necessarily:
print date(m/d/Y,strtotime(next saturday));
02/09/2008
print date(m/d/Y,strtotime(next sunday));
02/10/2008
print date(m/d/Y,strtotime(next monday));
02/11/2008
print date(m/d/Y,strtotime(next
On 31/01/2008, Mike Morton [EMAIL PROTECTED] wrote:
I have been using:
$nextSaturday= date(m/d/Y,strtotime(next saturday));
For months long time now with out problems, but in the last two days, it
went kind of funky. It is now returning:
02/09/2008 instead of the expected 02/02/2008. I
On 31/01/2008, Mike Morton [EMAIL PROTECTED] wrote:
Ya - the other server is 4.4.7
However - this does not seem to be the problem necessarily:
print date(m/d/Y,strtotime(next saturday));
02/09/2008
print date(m/d/Y,strtotime(next sunday));
02/10/2008
print date(m/d/Y,strtotime(next
Maybe it's just me, but I've never quite figured out what people mean
when they say next Saturday...
Do they mean the next one coming up?
Or do they mean that there's this Saturday coming up and next
Saturday the one after that?
And if I can't figure it out, why would you expect PHP to figure
Mike Morton schreef:
Good point ;)
Except that generally, when am told next Saturday - I take that to mean
the next Saturday - just one more ambiguity in the english language that
makes it so hard to learn I suppose!
The odd thing about this whole situation it that it seems to have cropped up
Good point ;)
Except that generally, when am told next Saturday - I take that to mean
the next Saturday - just one more ambiguity in the english language that
makes it so hard to learn I suppose!
The odd thing about this whole situation it that it seems to have cropped up
just after we upgraded
On Thu, January 31, 2008 3:29 pm, Mike Morton wrote:
Except that generally, when am told next Saturday - I take that to
mean
the next Saturday - just one more ambiguity in the english language
that
makes it so hard to learn I suppose!
strtotime has always seemed to me like it's bordering on
On 6/20/07, Phil Princely [EMAIL PROTECTED] wrote:
using this code:
function test_time($time_string) {
echo strftime(%X %A, %b %e\n, strtotime($time_string));
You should be testing the strtotime() call's return value, it returns
false on failure.
if (($timestamp = strtotime($str)) ===
Hi all
I'm new to this list. I hope this hasn't been discussed already.
using this code:
function test_time($time_string) {
echo strftime(%X %A, %b %e\n, strtotime($time_string));
}
test_time('now');
test_time('4pm + 2 Hours');
test_time('now + 2 fortnights');
test_time('last Monday');
Ron Piggott (PHP) wrote:
I have used the strtotime command to calculate a week ago (among other
things) with syntax like this:
$one_week_ago = strtotime(-7 days);
$one_week_ago = date('Y-m-d', $one_week_ago);
How would you use this command to figure out the last day of the month
in two months
On 24 Oct 2006, at 19:07 , Brad Chow wrote:
$date=(2006-10-26);
$date=strtotime($date);
$date=date('Y-m-1',$date);
$now=strtotime(+3 month, strtotime($date));
$lastday=strtotime(-1 day, $now);
echo date('Y-m-d',$lastday);
//2006-12-31
Yep, that's pretty much exactly what I do. I suspect there
I have used the strtotime command to calculate a week ago (among other
things) with syntax like this:
$one_week_ago = strtotime(-7 days);
$one_week_ago = date('Y-m-d', $one_week_ago);
How would you use this command to figure out the last day of the month
in two months from now --- Today is
Ron Piggott (PHP) wrote:
I have used the strtotime command to calculate a week ago (among other
things) with syntax like this:
$one_week_ago = strtotime(-7 days);
$one_week_ago = date('Y-m-d', $one_week_ago);
How would you use this command to figure out the last day of the month
in two months
Dear Ron:
I have a solution as follows:
$date=(2006-10-26);
$date=strtotime($date);
$date=date('Y-m-1',$date);
$now=strtotime(+3 month, strtotime($date));
$lastday=strtotime(-1 day, $now);
echo date('Y-m-d',$lastday);
//2006-12-31
It's a very easy way to do you want.
I use strtotime to convert
I am trying to convert a date and time (from the apache2 server logs) in
the format of 27/Aug/2006:19:02:20 +0200 to a UNIX timestamp and then
reformat it as a RFC compliant date by using date('r', $thedate);
My problem is as such. In PHP-5.1.2 it works perfectly and returns the
correct date. In
Richard Lynch wrote:
On Tue, May 24, 2005 7:24 am, Rahul S. Johari said:
Im trying to delete all files in a folder based on a string match with
the
following code:
?
$dir = '/Library/WebServer/Documents/something.com/subfolder/';
$dp = opendir($dir) or die ('Fatal Error: '.mysql_error());
Ave,
I¹m trying to delete all files in a folder based on a string match with the
following code:
?
$dir = '/Library/WebServer/Documents/something.com/subfolder/';
$dp = opendir($dir) or die ('Fatal Error: '.mysql_error());
while ($file = readdir($dp)) {
if ((eregi('.png',$file))
On Tue, May 24, 2005 7:24 am, Rahul S. Johari said:
I¹m trying to delete all files in a folder based on a string match with
the
following code:
?
$dir = '/Library/WebServer/Documents/something.com/subfolder/';
$dp = opendir($dir) or die ('Fatal Error: '.mysql_error());
while ($file =
Hi!
I'm back hahaha :D
I'm making functions to calculate the duration (only laboral days)
between 2 dates and the initial and final date between a duration give
me in laboral days.
I use the following function to make the diference between 2 dates:
function
Mario de Frutos Dieguez wrote:
Hi!
I'm back hahaha :D
I'm making functions to calculate the duration (only laboral days)
between 2 dates and the initial and final date between a duration give
me in laboral days.
I use the following function to make the diference between 2 dates:
function
On Mon, April 4, 2005 3:14 pm, Al said:
Suddenly my strtotime() are goofy, anyone have any ideas?
echo date('Y/m/d/H', time()). br; //2005/04/04/18
echo date('Y/m/d/H', strtotime(-1 day)). br;
//2005/04/03/18
echo date('Y/m/d/H', strtotime(last
Suddenly my strtotime() are goofy, anyone have any ideas?
echo date('Y/m/d/H', time()). br; //2005/04/04/18
echo date('Y/m/d/H', strtotime(-1 day)). br;
//2005/04/03/18
echo date('Y/m/d/H', strtotime(last Sunday)). br;
//2005/04/02/23
How is this not a bug?
?php
print date('Y-m-d H:i:s', strtotime('now UTC')).\n;
print date('Y-m-d H:i:s', strtotime('now PST')).\n;
?
outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)
The time zone correction is applied in the wrong direction. Does it in
both current PHP 4
Marcus Bointon wrote:
How is this not a bug?
?php
print date('Y-m-d H:i:s', strtotime('now UTC')).\n;
print date('Y-m-d H:i:s', strtotime('now PST')).\n;
?
outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)
PST = UTC - 8, therefore if you ask for strtotime in PST it will give
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give
you now + 8. This is standard in most languages, you are just reading
the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for is the
current local
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give
you now + 8. This is standard in most languages, you are just
reading the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give
you now + 8. This is standard in most languages, you are just reading
the functionality back to front.
ie when you say strtotome('now PST'), what you are asking for
Tom wrote:
Marcus Bointon wrote:
On 18 Jan 2005, at 10:53, Tom wrote:
PST = UTC - 8, therefore if you ask for strtotime in PST it will give
you now + 8. This is standard in most languages, you are just
reading the functionality back to front.
ie when you say strtotome('now PST'), what you are
Marcus Bointon wrote:
Much of the point of using zone names rather than fixed numeric
offsets is that it allows for correct daylight savings calculations
(assuming that locale data is correct on the server).
Let me rephrase the question - how can I get the current time in a
named time zone
Alex Hogan wrote:
Does anybody know of any peculiarities in the strtotime() function?
If I enter any date before 1 Jan 1970 I get a -1 returned.
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
Does anybody know of any peculiarities in the strtotime() function?
If I enter any date before 1 Jan 1970 I get a -1 returned.
alex hogan
*
The contents of this e-mail and any files transmitted with
http://us3.php.net/manual/en/function.strtotime.php
Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901
20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that
correspond to the minimum and maximum values for a 32-bit signed integer.)
Additionally, not all
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()
{
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
WOW! Blindingly simple mistake -- couldn't see the forest before the
trees (or something like that). THANKS for the helping hand!
Gnik
--- Eugene Lee [EMAIL PROTECTED] wrote:
On Fri, Nov 14, 2003 at 08:53:41PM -0800, Gnik wrote:
:
: One of my servers required a PHP upgrade. Afterwards one of
On Fri, Nov 14, 2003 at 08:53:41PM -0800, Gnik wrote:
:
: One of my servers required a PHP upgrade. Afterwards one of the PHP
: projects stopped functioning. When it would run one section would
: scroll endlessly. I can't figure out if it's a 'bug' or if it's bad
: logic in the coding.
Bad
--- Gnik [EMAIL PROTECTED] wrote:
I isolated the problem to be in the 'strtotime' function. Here is a
test I ran - when it runs, after getting to 2003-10-26, it scrolls
incessently:
BEGIN CODE--
?php
$stop= 2003-12-27 ;
$start= 2003-01-01 ;
While ($start $stop) {
echo BR
Greetings,
One of my servers required a PHP upgrade. Afterwards one of the PHP
projects stopped functioning. When it would run one section would scroll
endlessly. I can't figure out if it's a 'bug' or if it's bad logic in the
coding.
I isolated the problem to be in the 'strtotime' function.
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
strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 ));
I get back the timestamp for 1/31/2003 and not 2/1/2003.
Are you sure?
Yeah, but I missed something in my above example. If I did this:
strtotime( '+1 month GMT', mktime( 0, 0, 0, 1, 1, 2003 ));
It came back with 1/31/2003 and
strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 ));
I get back the timestamp for 1/31/2003 and not 2/1/2003.
Are you sure?
I tried it on my system (php 4.2.3 freeBSD 4.6.2) and this is the output I
got...
# php
?php
echo date(Y-m-d, mktime( 0, 0, 0, 1, 1, 2003 )).\n;
echo
My feeling is you should use gmmktime() if you use GMT in strtotime()
Chris Boget wrote:
Yeah, but I missed something in my above example. If I did this:
strtotime( '+1 month GMT', mktime( 0, 0, 0, 1, 1, 2003 ));
It came back with 1/31/2003 and not 2/1/2003. Removing the GMT
made it work.
I'm curious why this function uses a static value of 30
days to represent a month. If I do:
strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 ));
I get back the timestamp for 1/31/2003 and not 2/1/2003.
30 days != 1 month necessarily and I'm curious why it
does in strtotime();.
Chris
--
1 - 100 of 120 matches
Mail list logo