Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. $db = 'foobar'; // My Database Object (please ignore)
  2. $tz = '-4:00';
  3.  
  4. print_r($db->fetch("SELECT timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')) AS tz_offset"));
  5. print_r($db->fetch("SELECT created FROM inventory LIMIT 1"));
  6.  
  7. $db->query("SET time_zone = ?", $tz);
  8.  
  9. print_r($db->fetch("SELECT timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00')) AS tz_offset"));
  10. print_r($db->fetch("SELECT created FROM inventory LIMIT 1"));
  11.  
  12. Array ([tz_offset] => -04:00:00)
  13. Array ([created] => 2013-01-08 20:58:39)
  14. Array ([tz_offset] => -04:00:00)
  15. Array ([created] => 2013-01-08 21:58:39)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement