[Software] [Solved] Time showed for Tehran is wrong

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
Hadi_Lovelorn
Posts: 131
Joined: 2022-05-02 23:12
Been thanked: 1 time

[Software] [Solved] Time showed for Tehran is wrong

#1 Post by Hadi_Lovelorn »

My system clock was wrong about some hours and minutes , But Debian Time ( As I set it Automatically from Internet ) was 25 minutes later ... So today I set-up my System time and logged in to Debian and now Debian is 3 hours and 50 minutes later and wrong !

I have enabled Location Services ( As default ) and Automatic Time Zone .... Should I change it manually ? Is it true ? Why Debian Internet services are wrong ?
Last edited by Hadi_Lovelorn on 2024-09-19 21:04, edited 2 times in total.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2088
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 160 times
Been thanked: 225 times

Re: [Software] Timw showed for Tehran is wrong

#2 Post by Hallvor »

Please post the output of

Code: Select all

timedatectl
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
Hadi_Lovelorn
Posts: 131
Joined: 2022-05-02 23:12
Been thanked: 1 time

Re: [Software] Timw showed for Tehran is wrong

#3 Post by Hadi_Lovelorn »

Hallvor

Hello Sir

This is the output :

Code: Select all

Local time: Fri 2024-09-20 01:53:48 +0330
           Universal time: Thu 2024-09-19 22:23:48 UTC
                 RTC time: Thu 2024-09-19 22:23:49
                Time zone: Asia/Tehran (+0330, +0330)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2088
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 160 times
Been thanked: 225 times

Re: [Software] Timw showed for Tehran is wrong

#4 Post by Hallvor »

OK, I see the issue. Network Time Protocol (NTP) isn't set up properly.

Enter these commands as root or sudo

Install NTP (if not already installed):

Code: Select all

apt install ntp
Enable NTP:

Code: Select all

timedatectl set-ntp true
Check status:

Code: Select all

timedatectl status
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
Hadi_Lovelorn
Posts: 131
Joined: 2022-05-02 23:12
Been thanked: 1 time

Re: [Software] Timw showed for Tehran is wrong

#5 Post by Hadi_Lovelorn »

I installed NTP as Sudo , then

It gives error :

Code: Select all

Failed to set ntp: NTP not supported

Aki
Global Moderator
Global Moderator
Posts: 3924
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 108 times
Been thanked: 517 times

Re: [Software] Timw showed for Tehran is wrong

#6 Post by Aki »

Hadi_Lovelorn wrote: 2024-09-19 18:54 This is the output :

Code: Select all

Local time: Fri 2024-09-20 01:53:48 +0330
           Universal time: Thu 2024-09-19 22:23:48 UTC
                 RTC time: Thu 2024-09-19 22:23:49
                Time zone: Asia/Tehran (+0330, +0330)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no
The local time looks like right to me (it is 3:30 after the UTC time, as configured in the time zone).

Note: please correct the typo in the subject of the first post
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2088
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 160 times
Been thanked: 225 times

Re: [Software] Timw showed for Tehran is wrong

#7 Post by Hallvor »

Do you have systemd-timesyncd installed?
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
Hadi_Lovelorn
Posts: 131
Joined: 2022-05-02 23:12
Been thanked: 1 time

Re: [Software] Time showed for Tehran is wrong

#8 Post by Hadi_Lovelorn »

Aki

I corrected , I apologize

Hallvor

I don't know sir ... I didn't install something like that ... Should I install it ? Is the package name systemd-timesyncd ?

User avatar
Hadi_Lovelorn
Posts: 131
Joined: 2022-05-02 23:12
Been thanked: 1 time

Re: [Software] Time showed for Tehran is wrong

#9 Post by Hadi_Lovelorn »

Aki
Hallvor

The time get corrected automatically !! Like a charm .... Thank You , Both ....... Now it shows 12:32 for Tehran ....... Hoping it don't broken again .......

Thank You

Post Reply