AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[timezone](ubuntu)

Martin Hope
paymex
Asked: 2021-07-06 01:10:03 +0800 CST

Golang:时间戳添加不起作用

  • -2

任务是这样的,我需要在时间戳上加5分钟,但是无论我做什么,时间都不会改变,我做错了什么?

示例: https: //play.golang.org/p/AavonfZk2bn

timezone
  • 1 个回答
  • 41 Views
Martin Hope
AATHITH RAJENDRAN
Asked: 2019-12-27 01:09:34 +0800 CST

亚洲/加尔各答时区更改为 PST

  • 2

我做了什么:

运行这个命令:

sudo cp /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

发生了什么:

我的当地时间更改为 PST。现在我跑了:

sudo cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

但是我的系统时间并没有变回 IST。相反,它使用 IST 标签显示 PST 的时间。

显示错误时区的屏幕截图

(在图片中:我指的是 IST 加尔各答,但突出显示的时区是洛杉矶。这可以解释我的问题。)

预期结果:

我希望亚洲/加尔各答恢复正常。

PS:用命令

sudo timedatectl set-timezone Asia/Kolkata

时区更改为 IST 与 PST 的时间。

time timezone 18.04
  • 3 个回答
  • 8157 Views
Martin Hope
GabrieleMartini
Asked: 2019-11-23 01:21:43 +0800 CST

timedatectl:找不到命令

  • 6

场景:我正在尝试在基于 Ubuntu 18.04 docker 映像的 docker 容器上设置时区。只需拉取图像并更新

> apt-get -y update

错误:

运行时

> timedatectl

我明白了

> timedatectl: command not found

问题:如何安装timedatectl?

到目前为止我尝试过的:我尝试按如下方式安装 timedatectl

> apt-get -y install timedatectl
> Unable to locate package timedatectl

谢谢

package-management timezone docker 18.04
  • 1 个回答
  • 39973 Views
Martin Hope
EdK
Asked: 2019-10-21 14:57:57 +0800 CST

时区更改不会持续

  • 3

我正在运行 Ubuntu 18.04.3,我对时区所做的更改不会持续存在。也就是说,我进行了更改,并且在 5-20 分钟内的某个时间点,时钟恢复为 UTC 时间。

我已经使用 GUI 和命令行更新了时区:

sudo timedatectl set-timezone "Pacific/Auckland"
sudo dpkg-reconfigure -f noninteractive tzdata

我也玩过“自动日期/时间”和“自动时区”设置,无论它们是打开还是关闭都没有任何区别。

在线搜索此问题时,我找不到任何类似的报告。

任何有关如何调查或解决此问题的建议将不胜感激。

time timezone 18.04
  • 1 个回答
  • 954 Views
Martin Hope
lonix
Asked: 2019-09-03 05:02:15 +0800 CST

timedatectl 不使用命名区域

  • 0

设置时区的典型方法是使用timedatectl,例如:

sudo timedatectl set-timezone America/New_York

所以我可以使用命名区域,或者UTC.

但是我如何设置没有名称的区域 - 例如UTC-5或UTC+10其他什么?

timezone
  • 1 个回答
  • 84 Views
Martin Hope
flamingo_stark
Asked: 2019-08-11 06:11:38 +0800 CST

Ubuntu 18.04 Desktop - 日期和时间同步问题

  • 1

几天前,我在笔记本电脑上进行了 Ubuntu 18.04 LTS 的全新安装。在安装过程中,我选择了时区作为我的本地时区,即印度加尔各答(印度标准时间)。但是,启动我的系统后,时间和日期显示的值不正确。

显示值:

日期:2019 年 8 月 11 日星期日时间:06:21:xx

当时的实际值:

日期:2019年8月10日星期六时间:19:21:xx

准确地说,显示的时间比实际时间提前了 11 小时。

错误的日期和时间

在 Settings --> Date and Time 中,还启用了 Automatic Date and Time 和 Automatic Time Zones 开关。

启用自动更新日期和时间

我在互联网上发现了一些我试图分析/解决问题的文章(附截图)。

  1. 跑timedatectl

                         Local time: Sun 2019-08-11 06:27:44 IST
                      Universal time: Sun 2019-08-11 00:57:44 UTC
                            RTC time: Sun 2019-08-11 00:57:44
                           Time zone: Asia/Kolkata (IST, +0530)
           System clock synchronized: yes
    systemd-timesyncd.service active: yes
                     RTC in local TZ: no
    
  2. 已安装ntp

    $ sudo dpkg -s ntp | grep Status
    Status: install ok installed
    
  3. 跑sudo ntpq -p

     0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
     1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
     2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
     3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
     ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000
    

    ntpq 命令输出

  4. 运行sudo nmap -p123 -sU -P0 localhost。我认为它会检查 UDP 端口 123 的状态。

    Starting Nmap 7.60 ( https://nmap.org ) at 2019-08-11 07:09 IST
    Nmap scan report for localhost (127.0.0.1)
    Host is up (0.00024s latency).
    
    PORT    STATE SERVICE
    123/udp open  ntp
    
    Nmap done: 1 IP address (1 host up) scanned in 0.33 seconds
    

    更新端口 123 状态检查

我需要执行哪些后续步骤才能解决此问题?

ntp time timezone 18.04
  • 1 个回答
  • 1810 Views
Martin Hope
Venki
Asked: 2018-09-12 03:31:59 +0800 CST

在不同时区的命令输出中显示日期

  • 1

我有 27 个系统连接到服务器。其中,一些系统位于不同的时区。所以,当一个人在一天中第一次打开系统时,我需要在 IST 中找到用户的登录时间,但它显示在他们各自的时区(例如 BST)。

我可以使用w或获取信息who。如何在不更改这些客户端系统的时区的情况下获得 IST 的时间?

command-line time timezone
  • 1 个回答
  • 355 Views
Martin Hope
Luke
Asked: 2018-04-23 22:36:16 +0800 CST

cron 会自动适应时区变化吗?

  • 1

我添加了cron一份工作crontab -e。然后,我更改了时区。

但是,该工作似乎cron仍在旧时区进行。

我需要重新启动它cron吗?(例如service cron reload)

谢谢。

cron timezone schedule
  • 1 个回答
  • 2964 Views
Martin Hope
user8070445
Asked: 2018-04-18 19:44:06 +0800 CST

如何永久更改系统时区?

  • 1

“dpkg-reconfigure tzdata”完美地完成了这项工作。但我需要一种不包含基于文本的 gui 的方法。我已经搜索并看到了一些需要使用“tzselect”然后导出“TZ”环境变量的方法,而其他人建议创建符号链接“ln -s /usr/share/zoneinfo//etc/localtime”。你能告诉我使用哪一个,以便系统时间在重新启动后永久更改并保持不变。

dpkg timezone system-settings
  • 1 个回答
  • 4752 Views
Martin Hope
Hagen von Eitzen
Asked: 2018-04-02 05:54:59 +0800 CST

exiftool 和 geosync 的问题,可能与夏令时有关

  • 0

我想对我所有的假期照片进行地理标记exiftool,如下所示:

exiftool -geotag "*.gpx" \
 -geosync "19:25:42Z@IMG_7882.jpg" \
 -geosync "09:16:34Z@IMG_9798.jpg" \
 -ext .jpg .

其中 IMG_7802.jpg 是我的计算机时钟的照片,显示 2018 年 3 月 1 日的 20:25:42 MEZ (=19:25:42 Zulu),同样 IMG_9798.jpg 是我的计算机时钟的照片,显示时间为 11:16:34 MESZ 于 2018 年 3 月 31 日(=09:16:34 祖鲁语)。我使用了两个这样的(包围式)参考图像来解释漂移(实际上,相机时钟在那个月似乎增加了 26 秒)。

参考图像的调整很好:

$ exiftool -datetimeoriginal -gpsdatetime IMG_7882.jpg 
Date/Time Original              : 2018:03:01 20:25:42
GPS Date/Time                   : 2018:03:01 19:25:42Z
$ exiftool -datetimeoriginal -gpsdatetime IMG_9798.jpg
Date/Time Original              : 2018:03:31 10:17:00
GPS Date/Time                   : 2018:03:31 09:16:34Z

但是对于中间图像,计算出的 GPS 时间显着偏离,例如在以下示例中大约半小时(我所期望的大约 14:32Z 的 GPS 时间)

$ exiftool -datetimeoriginal -gpsdatetime IMG_8888.jpg
Date/Time Original              : 2018:03:17 15:32:22
GPS Date/Time                   : 2018:03:17 15:04:13.45312997Z

因此,计算出的经度和纬度也相距甚远。

我有根据的猜测是,问题与两个参考图像之间在德国开始的夏令时有关。显然,exiftool在本地时间解释 DateTimeOriginal (所以首先 MEZ =+0100然后 MESZ = +0200),而相机时钟只是不断滴答作响(大约有一个+0100偏移量)。

问:如何判断exiftool不要假设相机时钟 (DateTimeOriginal) 遵循任何夏令时规则?

clock timezone camera exiftool
  • 1 个回答
  • 248 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve