0

Note: By "Disable" daylight savings time, I mean for the system clock to ignore any time changes for daylight savings time (ie, if DST is disabled, then the clock will not "spring forward" an hour in March and will not "fall back" an hour in November.

I am designing an Qt application to run on Ubuntu 18.04 and I need to be able to set system timezone, time and date.

For settings time and date, I can easily use timedatectl to modify the system settings. However, this command does seem to be able to disable Daylight Savings Time. It does report whether DST is "Active" or not depending on the timezone and date, but you cannot disable/enable this settings.

On Windows, I had used tzutil.exe to setting DST enabled or not using the dst_off flag. Is there are any equivalent to Ubuntu?

  • Do you want to use UTC, or your local time minus DST? – glenn jackman Jul 10 at 14:33
  • @glennjackman I want to be able to change to any Time Zone, but with the option of disabling/enabling DST depending on what the user selects – Django Jul 10 at 14:36
  • I don't know if it's possible to select a DST-enabled timezone (i.e. America/New_York) and "turn off" DST. I don't know what Microsoft does, but I wouldn't be surprised if they have re-implemented the Olson timezone database for their own purposes. You might want to ask this question on Stack Overflow or Server Fault 3,495. – glenn jackman Jul 10 at 14:41
  • I will consult Stack Overflow. Thank you for your answer. – Django Jul 10 at 15:02
  • What do exactly mean by "system clock"? If you mean the value returned by gettimeofday(), used for the timestamp of newly created files etc. (as opposed to the RTC/hardware/BIOS clock), it never does DST adjustments. – egmont Jul 10 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.