How do you set the time in Postgres?
How do you set the time in Postgres? I've set the time zone in Postgres to Eastern Standard Time using set timezone='-5'
. However, the time was 45 minutes off where it should have been. Thinking Postgres was getting the time from Linux, I set the date i开发者_开发百科n Linux using date -s="24 AUG 2011 13:48"
and rebooted, and yet the problem persists.
Any ideas?
Postgresql will get its time (not necessarily time zone) setting from the OS, yes.
If your Linux machine has internet access, you can install NTP to keep the time in sync. Simply setting the time locally should be persisted back to the BIOS RTC, though.
精彩评论