I'm taking a postgres timestamp from the database to something I can parse with PHP (i.e., a unix timestamp. Thing is, the date function isn't giving me the result I expect. Check this out:


print date ("m/d/y h:m:s A", mktime(16, 30, 0, 10, 10, 2003));

gives the output: 10/10/03 04:10:00 AM

Where did the 4:10 come from? It should be 4:*30*. To make things stranger, when I change the month field in mktime to 9, like so:

print date ("m/d/y h:m:s A", mktime(16, 30, 0, 9, 10, 2003));

I get the output: 09/10/03 04:09:00 AM

It works the same way if I feed date a Unix timestamp, so I'm sure this is a date problem. (using mktime in my example here is just clearer than playing with unix timestamps).

date() and mktime() are usually simple enough, but something is going wrong. Perhaps it is a dumb mistake on my part, but I'm not seeing it....

peter


-- Peter Torraca Webmaster, Math Department Purdue Univ., Math 813 765-494-9998

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



Reply via email to