How to change my UTC time as similar to my local time? The local time and RTC time displays the correct time, but UTC time is wrong and my DB and code chooses the UTC time. So how to change the Universal Time?


       Local time: Tue 2021-06-08 00:33:24 IST
   Universal time: Mon 2021-06-07 19:03:24 UTC
         RTC time: Tue 2021-06-08 00:33:24
        Time zone: Asia/Kolkata (IST, +0530)
  • 2
    unless I'm missing something here - you can't change UTC, it's the same time throughout the world. Universal Time Coordinated as used by the aviation and marine sectors military etc. – 24601 Jun 8 at 11:00
  • 2
    UTC time is standard time set by world clocks (the same anywhere in the world, zulu/GMT/etc are all UTC), having it adjustable or controllable by a user (and not pre-defined) makes no sense at all. – guiverc Jun 8 at 11:03
  • 2
    You didn't post the complete output of timedatectl, but assuming that your UTC time is correct (= your clock is synchronized), instead of trying to change the UTC (which is not possible) you should change the settings of your "DB" (whatever that is) to use your "local time". So your question should be: How do I change my DB (or its front end) settings to use local time, instead of UTC? – FedonKadifeli Jun 8 at 11:48
  • I'm not sure this is what you want, but it keeps my Windows and Ubuntu times in sync: howtogeek.com/323390/… – C.S.Cameron Jun 8 at 12:15

You can set your date and time by opening Settings → Date & Time → and setting Automatic Date and Time to on.

Date & Time

Also, you could click on Time Zone, set in my case to CEST (Paris), where you can change your location from the interactive map using the search tool if necessary.

Time Zone setting

Once these settings are adjusted, the time stamps on program files (such as Databases, if that is what you mean by DB) and elsewhere should be correct.

  1. Open a terminal window by going to Applications → AccessoriesTerminal.

  2. Run:

    sudo dpkg-reconfigure tzdata
  3. Follow the directions in the terminal.

The timezone info is saved in /etc/timezone, which can be edited or used below.

Not the answer you're looking for? Browse other questions tagged or ask your own question.