Linux系统硬件时间12小时制和24小时

https://www.cnblogs.com/tdyk/articles/15735926.html

 

1 一个新装的服务器默认字符集是英文的。

[root@localhost /]# date -R
Mon, 27 Dec 2021 13:28:25 +0800
[root@localhost /]# clock -r
Mon 27 Dec 2021 01:34:06 PM CST -0.755124 seconds    时间也表示12小时制

[root@xb-server ~]# cat /etc/locale.conf 

LANG="en_US.UTF-8"

2 修改字符集source就可以将硬件时间修改为24小时制了

[root@localhost /]# cat /etc/locale.conf   修改为中文的字符集就可以了
LANG="zh_CN.UTF-8"

[root@localhost /]# source /etc/locale.conf   刷新一下修改的配置文件

[root@localhost /]# date
2021年 12月 27日 星期一 13:36:46 CST
[root@localhost /]# clock -r
2021年12月27日 星期一 13时36分51秒 -0.540879 秒

 

3 ll /etc/localtime 看下指向时区 注意做软连接。

有些服务器安装的时候不注意时区的选择

同步时区直接覆盖此文件

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


然后最好使用下面的命令将更改写入bios。 

同步硬件时间
 clock -w

注: 可以删除重新做个软链接。

posted on   四海骄阳  阅读(766)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
历史上的今天:
2019-05-31 数据库之闭包,范式
2019-05-31 数据库闭包和候选码求解方法
2019-05-31 元组

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示