class Foundation_API DateTime
/// This class represents an instant in time, expressed
/// in years, months, days, hours, minutes, seconds
/// and milliseconds based on the Gregorian calendar.
/// The class is mainly useful for conversions between
/// UTC, Julian day and Gregorian calendar dates.
///
/// The date and time stored in a DateTime is always in UTC
/// (Coordinated Universal Time) and thus independent of the
/// timezone in effect on the system.
///
/// Conversion calculations are based on algorithms
/// collected and described by Peter Baum at
/// http://vsg.cape.com/~pbaum/date/date0.htm
///
/// Internally, this class stores a date/time in two
/// forms (UTC and broken down) for performance reasons. Only use
/// this class for conversions between date/time representations.
/// Use the Timestamp class for everything else.
///
/// Notes:
/// * Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
/// * Year zero (0) is a leap year
/// * Negative years (years preceding 1 BC) are not supported
///
/// For more information, please see:
/// * http://en.wikipedia.org/wiki/Gregorian_Calendar
/// * http://en.wikipedia.org/wiki/Julian_day
/// * http://en.wikipedia.org/wiki/UTC
/// * http://en.wikipedia.org/wiki/ISO_8601

Epoch:

指的是一个特定的时间:1970-01-01 00:00:00 UTC。

UNIX时间戳:Unix时间戳(英文为Unix time, POSIX time 或 Unix timestamp)是从Epoch(1970年1月1日00:00:00 UTC)开始所经过的秒数,不考虑闰秒。

时间戳是自 1970 年 1 月 1 日(00:00:00 GMT)以来的秒数。它也被称为 Unix 时间戳(Unix Timestamp)。

Unix时间戳(Unix timestamp),或称Unix时间(Unix time)、POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01日00时00分00秒起至现在的总秒数。Unix时间戳不仅被使用在Unix系统、类Unix系统中,也在许多其他操作系统中被广泛采用。

UTC:

协调世界时(英:Coordinated Universal Time ,法:Temps Universel Coordonné),又称世界统一时间,世界标准时间,国际协调时间。英文(CUT)和法文(TUC)的缩写不同,作为妥协,简称UTC。

/// Monotonic UTC time value in 100 nanosecond resolution,

/// with base time midnight, October 15, 1582.

The Gregorian calendar is internationally the most widely used civil calendar. It is named after Pope Gregory XIII, who introduced it in October 1582.

Julian_day:

一般广泛用于 天文计时

闰年判断:

inline bool DateTime::isLeapYear(int year)

{

return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);

}

最新文章

  1. (转载)最长递增子序列 O(NlogN)算法
  2. firefox访问失败的时间设置错误问题
  3. asp.net MVC dropList 绑定
  4. 用C语言实现有限状态自动机FSM
  5. BestCoder Round #85 sum
  6. 频繁模式挖掘apriori算法介绍及Java实现
  7. cocos2d-x笔记(十一)Lua发展飞机战争-5- 让飞机动
  8. 2014牡丹江区域赛H(特里)ZOJ3826
  9. Sql Server中三种字符串合并方法的性能比较
  10. REACT相关资料合集
  11. 如何使用Matlab产生对称矩阵
  12. JVM回收器与调优
  13. java ReentrantLock结合条件队列 实现生产者-消费者模式 以及ReentratLock和Synchronized对比
  14. python print()内置函数
  15. php 请求另一个服务器接口返回数据
  16. Html5之Web存储
  17. 求和(NOIP2015)
  18. 装饰器(Decorator)模式
  19. Java基础-SSM之Spring的POJO(Plain Old Java Object)实现AOP
  20. FieldExists

热门文章

  1. 【打CF,学算法——一星级】Codeforces Round #313 (Div. 2) A. Currency System in Geraldion
  2. WPF学习之深入浅出话模板
  3. String代码示例
  4. 【BZOJ3319】黑白树 并查集
  5. css jquery 实现轮播效果
  6. wx.onNetworkStatusChange(function (res) 监听网络状态变化 实践方案
  7. JavaScript及jQuery学习小结
  8. Appium 1.9.1 启动报错 Fatal TypeError: Class constructor BaseDriver cannot be invoked without 'new'
  9. iOS 多语言支持
  10. EASYARM-IMX283 nfs启动内核和根文件系统