php - Symfony2 Doctrine MySQL UTC_TIMESTAMP() -


i trying convert plain mysql query doctrine query builder in symfony2. had following part of select query calculating different between utc timestamp in rcv.rtcdatetime field , current utc:

timestampdiff(second, rcv.rtcdatetime, utc_timestamp()) utcdiff 

apparently utc_timestamp() function not available in doctrine. managed find current_timestamp() function in doctrine cannot find value supposed returned function. local server time or utc timestamp? tested on several servers , still not sure.

this library able extend doctrine orm timestampdiff function: https://github.com/orocrm/doctrine-extensions

the calculation function still executed on mysql server:

the mysql server has serveral ways configure timezone internally used operations. default should match systems timezone.

read more here: https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -