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. C#的类型列表

    以下是 C# 内建类型的列表: 类型 字节 描述 unsigned byte signed byte signed short unsigned short signed integer unsign ...

  2. insert小细节,大问题

    今天现场报流程无法查看,已查看流程表中没有数据了.昨天有运行过删除垃圾数据的脚步.大致过程是: create table bak_test a as select * from test; creat ...

  3. JAVA学习第五十二课 — IO流(六)File对象

    File类 用来给文件或者目录封装成对象 方便对文件与目录的属性信息进行操作 File对象能够作为參数传递给流的构造函数 一.构造函数和分隔符 public static void FileDemo( ...

  4. mfc 小程序---在系统菜单中添加菜单项

    1建立一个对话框工程:在dlg类里定义一个菜单指针m_pMenu,在对话框OnInitDialog函数里添加代码: m_pMenu=GetSystemMenu(FALSE);//获取系统菜单的指针 m ...

  5. 数据结构:最小生成树--Kruskal算法

    Kruskal算法 Kruskal算法 求解最小生成树的还有一种常见算法是Kruskal算法.它比Prim算法更直观.从直观上看,Kruskal算法的做法是:每次都从剩余边中选取权值最小的,当然,这条 ...

  6. [转]Struts form传值

    Struts form传值 大约三四个月没用过struts框架,突然想拾起来,却发现好多都忘了.出现传值传不过来的问题.没办法,上网查了一下,看见了一位老师的帖子,总结的很好.特此转载与分享,文末附链 ...

  7. 九度OJ 1018:统计同成绩学生人数 (基础题)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:8807 解决:4651 题目描述: 读入N名学生的成绩,将获得某一给定分数的学生人数输出. 输入: 测试输入包含若干测试用例,每个测试用例的 ...

  8. 【题解】DZY Loves Chinese

    [题解]DZY Loves Chinese II 不吐槽这题面了... 考虑如何维护图的连通性,如果把图的变成一颗的\(dfs\)生成树,那么如果把一个节点的父边和他接下来所有的返祖边删除,那么我们就 ...

  9. 洛谷2483 k短路([SDOI2010]魔法猪学院)

    题目请戳这里 一句话题意: 给你一张n个节点,m条单向边的图,求1到n第k短的路. emmm,纪念第一个黑题(我是真的菜啊!!) 这题目还是很难的,本蒟蒻只会被洛谷卡掉的A(所以就愉快地特判了),首先 ...

  10. fastjson(转)

    博客地址 :http://blog.csdn.NET/shulianghan/article/details/41011605 fastjson 源码地址 : -- GitHub : https:// ...