Welcome Guest, Not a member yet? Register   Sign In
mdate returning 12/31/1969 in date_helper.php
#2

[eluser]David Johansson[/eluser]
The time functions in php is built on unix timestamps which stores the seconds since 1970-01-01 00:00:00 in an integer. The fact that you get 1969-12-31 is probably due to some timezone setting. When you receive an integer from mysql it is always returned as a string and the date function is apparently unable to work with the string.
Also if there is someting wrong with your database query the value might be undefined. To view your last query use the command:
Code:
echo $this->db->last_query();
There might be some problem with the active record class trying to escape your query. This can easily be solved.

If you cant get it to work (which you should) you can use the mysql function date instead. Though i don't remeber the syntax of the function right now...


Messages In This Thread
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 03:00 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 03:26 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 03:30 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 03:37 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 04:03 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 05:02 PM
mdate returning 12/31/1969 in date_helper.php - by El Forum - 07-22-2009, 09:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB