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);

}

Unix Timestamp的更多相关文章

  1. [R语言]R语言计算unix timestamp的坑

    R+mongo的组合真是各种坑等着踩 由于mongo中的时间戳普遍使用的是unix timestamp的格式,因此需要对每天的数据进行计算的时候,很容易就想到对timestamp + gap对方式来实 ...

  2. js 取得 Unix时间戳(Unix timestamp)

    js 取得 Unix时间戳 Unix时间戳(Unix timestamp),或称Unix时间(Unix time).POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间19 ...

  3. 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)

    Java time JavaScript Math.round(new Date().getTime()/1000)getTime()返回数值的单位是毫秒 Microsoft .NET / C# ep ...

  4. Unix时间戳(Unix timestamp)转换工具

    http://tool.chinaz.com/Tools/unixtime.aspx 现在的Unix时间戳(Unix timestamp)是   1440732364         Unix时间戳( ...

  5. 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)?

    Java time JavaScript Math.round(new Date().getTime()/1000) 之所以除以1000是因为getTime()返回数值的单位是毫秒 Microsoft ...

  6. 在不同编程语言中对Unix时间戳进行转换(Unix timestamp)

    最近用到unix时间转换在mysql和.net中的应用.将此资料保存在博客中. 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)? Java time JavaScript ...

  7. [转]js 取得 Unix时间戳(Unix timestamp)

    本文转自:https://blog.csdn.net/o0snow/article/details/6858829 js 取得 Unix时间戳 Unix时间戳(Unix timestamp),或称Un ...

  8. win10 uwp unix timestamp 时间戳 转 DateTime

    有时候需要把网络的 unix timestamp 转为 C# 的 DateTime ,在 UWP 可以如何转换? 转换函数可以使用下面的代码 private static DateTime UnixT ...

  9. 时间戳Unix timestamp

    (1)定义 Unix时间戳(Unix timestamp),或称Unix时间(Unix time).POSIX时间(POSIX time),是一种时间表示方式,定义为从格林威治时间1970年01月01 ...

  10. 【.Net】win10 uwp unix timestamp 时间戳 转 DateTime

    有时候需要把网络的 unix timestamp 转为 C# 的 DateTime ,在 UWP 可以如何转换? 转换函数可以使用下面的代码 private static DateTime UnixT ...

随机推荐

  1. convert from EST/EDT to GMT

    TimeZoneInfo est = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); DateTime ...

  2. 在安装ubuntu时,卡在启动画面

    在我安装ubuntu时发生的情况,记录下来希望能帮助到需要帮助的朋友. 我先后尝试16.04与14.05两个版本的Ubuntu系统,方法均为:https://www.ubuntu.com/downlo ...

  3. python 基础 1.5 python数据类型(四)--字典常用方法示例

    一. 字典 #字典 dict1 = {'name':'lzc','age':'20','sex':'man'} print dict1 print type(dict1) >>> { ...

  4. VS2013 自动添加头部注释 -C#开发

    在团队开发中,头部注释是必不可少的.但在开发每次新建一个类都要复制一个注释模块也很不爽,所以得想个办法让开发工具自动生成我们所需要的模板.....操作方法如下: 方法/步骤 1 找你的vs安装目录, ...

  5. android菜鸟学习笔记10----Intent及<intent-filter>

    关于Bundle: 注意到Activity的onCreate()方法的签名是protected void onCreate(Bundle savedInstanceState),其参数是一个Bundl ...

  6. C#获取网页内容的三种方式(转)

    搜索网络,发现C#通常有三种方法获取网页内容,使用WebClient.WebBrowser或者HttpWebRequest/HttpWebResponse... 方法一:使用WebClient (引用 ...

  7. Grunt学习笔记【5】---- expand使用方法

    本文主要讲expand使用方法. 当你希望处理大量的单个文件时,这里有一些附加的属性可以用来动态的构建一个文件列表.这些属性都可以用于 Compact 和 Files Array 文件映射格式. ex ...

  8. 关于JavaScript中prototype机制的理解

    最近几天一直在研究JavaScript中原型的机制,从开始的似懂非懂,到今天终于有所领悟.不敢说彻底理解,但是起码算知道怎么回事了. 为什么一开始似懂非懂 开始了解一遍原型机制后,感觉知其然但不知其所 ...

  9. MySQL——存储引擎

    核心知识点 1.InnoDB:数据和索引存放在单独的文件,聚簇索引,行级锁,事务,MVCC 2.MyISAM: (1)缺点:不支持事务和表级锁,因为不支持表锁,锁颗粒比较大,因此适合只读和小文件. ( ...

  10. Java for LeetCode 097 Interleaving String 【HARD】

    Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given: s1 ...