【date】

设置时区为亚洲/上海

sudo timedatectl set-timezone Asia/Shanghai
sudo systemctl restart chronyd.service
#或者修改配置文件
sudo vi /etc/sysconfig/clock
#将ZONE="" 更改为 ZONE="Asia/Shanghai",然后重启系统使之生效。
sudo systemctl restart chronyd.service

以yyyy-MM-dd形式显示日期

data +'%Y-%m-%d'

以yyyy-mm-dd HH:Mi:SS形式显示日期

data +'%Y-%m-%d %H:%M:%S'

相关推荐

  1. date

    2024-07-14 01:22:02       17 阅读
  2. Date

    2024-07-14 01:22:02       23 阅读
  3. String转Date,Date转String

    2024-07-14 01:22:02       51 阅读
  4. MySQL-DATE_FORMAT()函数

    2024-07-14 01:22:02       63 阅读
  5. date工具类

    2024-07-14 01:22:02       46 阅读
  6. 【PGSQL】date_trunc 函数

    2024-07-14 01:22:02       49 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-14 01:22:02       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-14 01:22:02       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-14 01:22:02       57 阅读
  4. Python语言-面向对象

    2024-07-14 01:22:02       68 阅读

热门阅读

  1. Reinforement Learning学习记录(五)

    2024-07-14 01:22:02       17 阅读
  2. Docker 部署 Nginx 并在容器内配置申请免费 SSL 证书

    2024-07-14 01:22:02       21 阅读
  3. 牛客小白月赛98---切割 01 串 2.0

    2024-07-14 01:22:02       19 阅读
  4. 什么是计算机数据结构的字典

    2024-07-14 01:22:02       22 阅读
  5. 7.13扣...

    2024-07-14 01:22:02       21 阅读