Tweak database time handling