看到国外同一家公司发的两个文件, 前一个写的 dated 10.9.2017 (月日年格式), 后一个写的 dated 11/10/2017 (日月年格式). 如果没有其它信息, 这两个写法都不能确定唯一日期.
其实这样的事笔者遇到的不计其数, 后来发现老外也吃尽了苦头, 才弄了个国际标准 ISO 8601 来规范日期时间的写法, 见下文.
今天提及此事的另一个缘起是, 国内网站和APP的陋习,例如:
微信把日期时间写成这样:
3小时前
昨天
1110月
知乎把日期时间写成这样:
2小时前
1天前
5天前
请问这样转换一下的意义是什么? 有必要这样画蛇添足吗?
日常情况, 日期时间只有一种最优写法, 简单明确, 如下:
YYYY-MM-DD hh:mm
Date and time format - ISO 8601
ISO 8601 describes an internationally accepted way to represent dates and times using numbers.
When dates are represented with numbers they can be interpreted in different ways. For example, 01/05/12 could mean January 5, 2012, or May 1, 2012. On an individual level this uncertainty can be very frustrating, in a business context it can be very expensive. Organizing meetings and deliveries, writing contracts and buying airplane tickets can be very difficult when the date is unclear.
ISO 8601 tackles this uncertainty by setting out an internationally agreed way to represent dates:<