Hi does PHP 4.3 have a bug when it comes to timestamp'sLOL.
None that I know of. Can you be a bit more precise? Got some chunk of code that doesn't work? Anything at all?print mktime (0,0,0,12,12,1997) . "<br>";
print mktime(0,0,0,12,12,1970) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(0,0,0,12,12,1954) . "<br>";
print mktime(0,0,0,12,12,1914) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(12,0,0,12,12,1934) . "<br>";
881884800
29804400
-3662
-3662
-3662
-3662
-62
RegardsThat is not a bug.
EPOCH starts at January 1st, 1970, 00:00:00 UTC, if I'm not mistaken, and that is when the UNIX timestamp starts. So it it's not applicable to dates preceeding that date.
Perhaps this thread can help you in some way, whatever you're trying to accomplish with your script.
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=28952">http://www.htmlforums.com/showthread.ph ... adid=28952</a><!-- m -->
Cheers.Hi there,
just thought that I would chip in with a bit of information, seeing as how it appears there is a php expert (Rydberg) already contributing to this thread i'll keep it brief and to the point. The php documentation states quite clearly that:
"Rydberg is an idiot" oops sorry wrong page, it states:
"Year may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-99 to 1970-1999 (on systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038)"
just to reiterate:
"valid range for year is somewhere between 1901 and 2038)".
Cheers
Byeprint("PHP version" . phpversion() . "<br />");
print mktime(0,0,0,12,12,1997) . "<br>";
print mktime(0,0,0,12,12,1970) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(0,0,0,12,12,1954) . "<br>";
print mktime(0,0,0,12,12,1914) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(12,0,0,12,12,1934) . "<br>";
PHP version4.1.2
881884800
29804400
-1106265600
-475113600
-1737417600
-1106265600
-1106222400
so PHP 4.1.2 was able to calculate dates before 1970 so why cant a newer version, does not make sense to me unless off course its a bug.Oh, that's rather harsh. I'm just trying to help. Haven't claimed to be an expert.
Since UNIX timestamps have the range that they do, I didn't know that negative ones were acceptable. Now I do. On UNIX. If you're running Windows, it's not supported.
I can also quote the manual,
Windows: Negative timestamps are not supported under any known version of Windows. Therefore the range of valid years includes only 1970 through 2038.
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/function.mktime.php">http://www.php.net/manual/en/function.mktime.php</a><!-- m -->
I think an idiot is one who is stupid, but I was simply ignorant. Maybe you're the idiot, who overlooked this piece of information, which might very well be the solution?
Rydberg is correct. you must be on a windows machine as it works correctly on a Unix machine
PHP version4.3.1
881906400
29829600
-1106244000
-475092000
-1737396000
-1106244000
-1106200800
<!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=23748actually">http://bugs.php.net/bug.php?id=23748actually</a><!-- m --> we were both wrong
<!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=23475">http://bugs.php.net/bug.php?id=23475</a><!-- m -->
it is a bug in glibc 2.2.5Hah, well then so be it
I'm suspecting that this 'toodles', who actually made an account just to insult me, was somehow offended by my first post, or more exactly the 'LOL', which might sound arrogant. I don't mean it like "HAH, how can you be so stupid to think that there are bugs in PHP, I know there aren't any, and I know it all", not at all, I just find it funny that people post so vague questions in an advanced technical forum, and expect people to 'just know' what they mean. It's of course a very common mistake for 'newbies' in communities like this, but as I have now a lot of experience with online communities, forums, mailing lists, etc, I have just started to find it funny.
Please don't take any offence.Alright PHP people
thanks for helping me with the problem
sorry if the first text didnt have enough info i was in a rush, did get to the problem in the end
did think the first reply was a bit harsh a simple "not that i know off, what is it thats going wrong" would have been a bit more forthcoming
i am sure i will be posting things in the future so I hope you can help again (never know i may be as experianced as you one day then i can LOL when some newbie posts something)
None that I know of. Can you be a bit more precise? Got some chunk of code that doesn't work? Anything at all?print mktime (0,0,0,12,12,1997) . "<br>";
print mktime(0,0,0,12,12,1970) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(0,0,0,12,12,1954) . "<br>";
print mktime(0,0,0,12,12,1914) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(12,0,0,12,12,1934) . "<br>";
881884800
29804400
-3662
-3662
-3662
-3662
-62
RegardsThat is not a bug.
EPOCH starts at January 1st, 1970, 00:00:00 UTC, if I'm not mistaken, and that is when the UNIX timestamp starts. So it it's not applicable to dates preceeding that date.
Perhaps this thread can help you in some way, whatever you're trying to accomplish with your script.
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=28952">http://www.htmlforums.com/showthread.ph ... adid=28952</a><!-- m -->
Cheers.Hi there,
just thought that I would chip in with a bit of information, seeing as how it appears there is a php expert (Rydberg) already contributing to this thread i'll keep it brief and to the point. The php documentation states quite clearly that:
"Rydberg is an idiot" oops sorry wrong page, it states:
"Year may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-99 to 1970-1999 (on systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038)"
just to reiterate:
"valid range for year is somewhere between 1901 and 2038)".
Cheers
Byeprint("PHP version" . phpversion() . "<br />");
print mktime(0,0,0,12,12,1997) . "<br>";
print mktime(0,0,0,12,12,1970) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(0,0,0,12,12,1954) . "<br>";
print mktime(0,0,0,12,12,1914) . "<br>";
print mktime(0,0,0,12,12,1934) . "<br>";
print mktime(12,0,0,12,12,1934) . "<br>";
PHP version4.1.2
881884800
29804400
-1106265600
-475113600
-1737417600
-1106265600
-1106222400
so PHP 4.1.2 was able to calculate dates before 1970 so why cant a newer version, does not make sense to me unless off course its a bug.Oh, that's rather harsh. I'm just trying to help. Haven't claimed to be an expert.
Since UNIX timestamps have the range that they do, I didn't know that negative ones were acceptable. Now I do. On UNIX. If you're running Windows, it's not supported.
I can also quote the manual,
Windows: Negative timestamps are not supported under any known version of Windows. Therefore the range of valid years includes only 1970 through 2038.
<!-- m --><a class="postlink" href="http://www.php.net/manual/en/function.mktime.php">http://www.php.net/manual/en/function.mktime.php</a><!-- m -->
I think an idiot is one who is stupid, but I was simply ignorant. Maybe you're the idiot, who overlooked this piece of information, which might very well be the solution?
Rydberg is correct. you must be on a windows machine as it works correctly on a Unix machine
PHP version4.3.1
881906400
29829600
-1106244000
-475092000
-1737396000
-1106244000
-1106200800
<!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=23748actually">http://bugs.php.net/bug.php?id=23748actually</a><!-- m --> we were both wrong
<!-- m --><a class="postlink" href="http://bugs.php.net/bug.php?id=23475">http://bugs.php.net/bug.php?id=23475</a><!-- m -->
it is a bug in glibc 2.2.5Hah, well then so be it
I'm suspecting that this 'toodles', who actually made an account just to insult me, was somehow offended by my first post, or more exactly the 'LOL', which might sound arrogant. I don't mean it like "HAH, how can you be so stupid to think that there are bugs in PHP, I know there aren't any, and I know it all", not at all, I just find it funny that people post so vague questions in an advanced technical forum, and expect people to 'just know' what they mean. It's of course a very common mistake for 'newbies' in communities like this, but as I have now a lot of experience with online communities, forums, mailing lists, etc, I have just started to find it funny.
Please don't take any offence.Alright PHP people
thanks for helping me with the problem
sorry if the first text didnt have enough info i was in a rush, did get to the problem in the end
did think the first reply was a bit harsh a simple "not that i know off, what is it thats going wrong" would have been a bit more forthcoming
i am sure i will be posting things in the future so I hope you can help again (never know i may be as experianced as you one day then i can LOL when some newbie posts something)