I read a mysql timestamp can only hold a value from 19700101000000 to sometime in the year 2037. I seriously doubt my app will be around then, well i'm sure it wont but any idea what will people use then for a timestamp, a text field?
Below is an example of how I currently insert a mysql record with a datetime mysql field and you can see I use now() in the PHP below, now I am re-coding my site and I am going to offer timezone support for showing correct times to users so I needd to save date and time as a UTC timestamp.
<?PHP
$sql = "INSERT INTO online_users
(user_id,
online_id,
ip,
datetime,
location,
gender)
values ('$cache->userid,$unid,$LOCALIP,NOW(),$location,$g)";
executeQuery($sql);
?>
Based on my code above and my information above, how would I format this code to insert the time and date into UTC and should I use a timestamp field or a text field in MySQL? I will need to modify the time in my php when showing it often, for example on some posts I calculate the time that has passed since the mysql time (2 days and 4 hours and 34 seconds ago). I also need to use time to query for things like users in the past week to sign on. I am not asking how to do that stuff I just posted it to show what I will be using time for just in case that would help determine the best method I should be saving it as.