Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db = 'foobar'; // My Database Object (please ignore)
- $tz = '-4:00';
- print_r($db->fetch("SELECT timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')) AS tz_offset"));
- print_r($db->fetch("SELECT created FROM inventory LIMIT 1"));
- $db->query("SET time_zone = ?", $tz);
- print_r($db->fetch("SELECT timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')) AS tz_offset"));
- print_r($db->fetch("SELECT created FROM inventory LIMIT 1"));
- Array ([tz_offset] => -04:00:00)
- Array ([created] => 2013-01-08 20:58:39)
- Array ([tz_offset] => -04:00:00)
- Array ([created] => 2013-01-08 21:58:39)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement