惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Troy Hunt's Blog
Latest news
Latest news
Vercel News
Vercel News
S
SegmentFault 最新的问题
V
Vulnerabilities – Threatpost
博客园 - Franky
P
Privacy International News Feed
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
The Hacker News
The Hacker News
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
T
Threatpost
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Scott Helme
Scott Helme
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Microsoft Azure Blog
Microsoft Azure Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 司徒正美
A
About on SuperTechFans
Recorded Future
Recorded Future
爱范儿
爱范儿
L
LangChain Blog
V
V2EX
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
Webroot Blog
Webroot Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
D
DataBreaches.Net
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
C
Cisco Blogs
L
Lohrmann on Cybersecurity
Help Net Security
Help Net Security
AWS News Blog
AWS News Blog
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY

博客园 - 疯子峰

oracle性能分析2 oracle性能分析 诡异的socket连接失败 ELK配置watcher 多进程 vs 多线程 ELK日志平台 Java web项目 wordpress之客户端发布文章 神舟笔记本安装ubuntu 10.10 安装vs2010 AOP, Aspect-oriented programming 获取淘宝商品描述和价格 - 疯子峰 - 博客园 SPQuery查询语法简要说明(转) - 疯子峰 - 博客园 SPEmailEventReceiver 之导入附件EXCEL 为incoming mail绑定事件,SPEmailEventReceiver 安装Windows 2003更新后导致moss 无法访问 - 疯子峰 Ubuntu 的启动过程概览 linux 全局配置文件 vim 用户配置
关于时间
疯子峰 · 2017-04-03 · via 博客园 - 疯子峰

关于时间

(每日一篇,找个知识点巩固下,)

最近在搞云计算平台(rancher + kubernetes + ceph +。。。),踩坑正在进行中,以后再总结,今天先总结下时间格式(来源在此:https://unix4lyfe.org/time/?v=1)

UTC

协调世界时, 也叫世界标准时间,在零经度(本初子午线)的时间。1972年制定,精度为毫秒。

GMT

格林尼治时间,UTC的旧名,因为本初子午线经过了格林尼治皇家天文台

时区

以UTC世界为标准偏移,例如中国的时区为 UTC+0800

夏令时

不影响UTC

闰秒

UTC与原子时钟对其的一种方法。原子钟精度为纳秒,要求误差不超过0.9秒,顾需定时调整。闰秒会导致完全一样的timestamp

闰秒同步最多提前6个月通知。

Unix时间戳

从1970年1月1日(UTC/GMT的午夜)开始所经过的秒数,不考虑闰秒。根据POSIX.1,Unix时间戳通过重复解决同步问题,确保了

一天总是86400秒。

程序中需考虑的时间问题

时区是表现层的问题

保存时间请使用Unix时间,它只是数字(single)

如果要保存可读的时间信息,请和Unix时间一起保存,而不是替换Unix时间。

系统时间时不准确的且不受控制的,可跳秒,程序需充分考虑。

mysql(4.x,5.x)中datetime类型保存的是 “YYYY-MM-DD HH:MM:SS”格式的字符串,不包含时区,同过@@session.timezone解释成时间。