How do I cope with a bigint (milliseconds since 1970) got from a mysql table, when the max int size in php is a lot lower than this for current dates and times.
You can either
PHP's max int size is plenty big on a 64 bit architecture. What are you running it on? Other ideas include:
SELECT CAST(ts/1000 AS INT) AS ts