Techtrekking

mynotes PostgreSQL

By Pravin

check the timezone of database server

-- Check the setting name SHOW timezone; -- Check the actual calculated time (to verify) SELECT now();

set timezone to specific time. India: 'Asia/Kolkata'; Australia: 'Australia/Sydney'; USA: 'America/New_York';

-- temporary only for session SET timezone = 'Asia/Kolkata'; -- permanent ALTER DATABASE your_db_name SET timezone TO 'Asia/Kolkata'; --- The Global Server Level (The "Big Hammer") -- 1. Update the configuration ALTER SYSTEM SET timezone TO 'Asia/Kolkata'; -- 2. Reload the configuration (No restart required) SELECT pg_reload_conf();
Comments
No comments yet. Be the first to comment!
Leave a Comment
Your comment will be visible after approval.