{"id":15837895,"url":"https://github.com/sambacha/blockchain-time","last_synced_at":"2026-03-02T06:02:57.216Z","repository":{"id":103231311,"uuid":"340644463","full_name":"sambacha/blockchain-time","owner":"sambacha","description":"Papers and Resources for utilizing time on-chain and off-chain","archived":false,"fork":false,"pushed_at":"2024-08-23T12:14:52.000Z","size":241,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T01:57:05.703Z","etag":null,"topics":["blockchain","clock","ethereum","ntp","off-chain","on-chain","time","time-protocol"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sambacha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-20T12:01:57.000Z","updated_at":"2024-08-23T12:14:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"c615efbf-ca17-46f4-b50d-4e5df65a42e4","html_url":"https://github.com/sambacha/blockchain-time","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sambacha/blockchain-time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambacha%2Fblockchain-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambacha%2Fblockchain-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambacha%2Fblockchain-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambacha%2Fblockchain-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sambacha","download_url":"https://codeload.github.com/sambacha/blockchain-time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sambacha%2Fblockchain-time/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","clock","ethereum","ntp","off-chain","on-chain","time","time-protocol"],"created_at":"2024-10-05T15:42:20.842Z","updated_at":"2026-03-02T06:02:52.201Z","avatar_url":"https://github.com/sambacha.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: On the usage of Time in Blockchains\ntype: monograph\nversion: draft\nsummary: deterministic time tables and accounting\n---\n\n\n## Ethereum Genesis \n\n\u003e**Note**    \n\u003e block:0 Jul-30-2015 03:26:13 PM +UTC is not the 'true' timestamp for the genesis block.     \n\u003e block1: GMT: Thursday, July 30, 2015 3:26:28 PM.     \n\u003e Thursday, July 30, 2015 8:26:28 AM GMT-07:00 DST.   \n\n\n[see https://github.com/ethereum/go-ethereum/issues/17042#issuecomment-559414137](https://github.com/ethereum/go-ethereum/issues/17042#issuecomment-559414137)\n\nSo, etherscan does show the genesis: etherscan.io/block/0 -- but they must have put some hack into place to make it show up as (Jul-30-2015 03:26:13 PM +UTC) -- because AFIK the actual timestamp on the genesis is all zeroes, which is 1970. Unless I'm mistaken, there's no error in geth here, possibly etherscan.\n\nThe same holds when querying a node running Parity: timestamp for block 0 is 0. On the other hand, etherscan.io shows Jul-30-2015 03:26:13 PM +UTC as timestamp for the genesis block. It would be nice to have a consistent view, or at least an explanation like \"0 is correct, etherscan is just extrapolating\".\n\n[source, frontiner genesis: https://raw.githubusercontent.com/ethereum/ethereumj/develop/ethereumj-core/src/main/resources/genesis/frontier.json](https://raw.githubusercontent.com/ethereum/ethereumj/develop/ethereumj-core/src/main/resources/genesis/frontier.json)\n\n\n### Blockchain Time: On the subject of Time and its Implementations on-chain and off-chain\n\n\u003e Resources for utilizing time on-chain\n  * [Blockchain Time: On the subject of Time and its Implementations on-chain and off-chain](#blockchain-time--on-the-subject-of-time-and-its-implementations-on-chain-and-off-chain)\n  * [Background](#background)\n    + [time2posix](#time2posix)\n    + [strftime()](#strftime--)\n    + [TimeZones](#timezones)\n    + [Valid ISO 8601 date or time formats](#valid-iso-8601-date-or-time-formats)\n    + [Daylight Savings Changes](#daylight-savings-changes)\n- [CalSystems](#calsystems)\n- [Seconds](#seconds)\n- [UNIX](#unix)\n- [Time Stamp Formats](#time-stamp-formats)\n- [Time Stamp Conventions](#time-stamp-conventions)\n- [Julian-Gregorian Adoption Dates](#julian-gregorian-adoption-dates)\n  * [References](#references)\n\n\n## Block Timestamp Manipulation\n\n\u003e [source: sigmaprime blog ](https://blog.sigmaprime.io/solidity-security.html#keyless-eth:~:text=such%20a%20transaction.-,12.%20Block%20Timestamp%20Manipulation,but%20it%20is%20something%20to%20be%20aware%20of%20when%20developing%20contracts.,-Real%2DWorld%20Example)\n\nBlock timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion section for further details), locking funds for periods of time and various state-changing conditional statements that are time-dependent. Miner's have the ability to adjust timestamps slightly which can prove to be quite dangerous if block timestamps are used incorrectly in smart contracts.\n\nSome useful references for this are: The Solidity Docs, this Stack Exchange Question.\n\n### The Vulnerability\n`block.timestamp` or its alias `now` (depreciated) can be manipulated by miners if they have some incentive to do so. Let's construct a simple game, which would be vulnerable to miner exploitation,\n\n\n```solidity\n// roulette.sol:\ncontract Roulette {\n    uint public pastBlockTime; // Forces one bet per block\n\n    constructor() public payable {} // initially fund contract\n\n    // fallback function used to make a bet\n    function () public payable {\n        require(msg.value == 10 ether); // must send 10 ether to play\n        require(now != pastBlockTime); // only 1 transaction per block\n        pastBlockTime = now;\n        if(now % 15 == 0) { // winner\n            msg.sender.transfer(this.balance);\n        }\n    }\n}\n```\n\nThis contract behaves like a simple lottery. One transaction per block can bet 10 ether for a chance to win the balance of the contract. The assumption here is that, block.timestamp is uniformly distributed about the last two digits. If that were the case, there would be a 1/15 chance of winning this lottery.\n\nHowever, as we know, miners can adjust the timestamp, should they need to. In this particular case, if enough ether pooled in the contract, a miner who solves a block is incentivised to choose a timestamp such that block.timestamp or now modulo 15 is 0. In doing so they may win the ether locked in this contract along with the block reward. As there is only one person allowed to bet per block, this is also vulnerable to front-running attacks.\n\n\u003e **Note** \n\u003e block timestamps are monotonically increasing and so miners cannot choose arbitrary block timestamps (true for Ethereum1)\n\nIn practice, block timestamps are monotonically increasing and so miners cannot choose arbitrary block timestamps (they must be larger than their predecessors). They are also limited to setting blocktimes not too far in the future as these blocks will likely be rejected by the network (nodes will not validate blocks whose timestamps are in the future).\n\n### Preventative Techniques\n\nBlock timestamps should not be used for entropy or generating random numbers - i.e. they should not be the deciding factor (either directly or through some derivation) for winning a game or changing an important state (if assumed to be random).\n\nTime-sensitive logic is sometimes required; i.e. unlocking contracts (timelocking), completing an ICO after a few weeks or enforcing expiry dates. It is sometimes recommend to use block.number (see the Solidity docs) and an average block time to estimate times; .i.e. 1 week with a 10 second block time, equates to approximately, 60480 blocks. Thus, specifying a block number at which to change a contract state can be more secure as miners are unable to manipulate the block number as easily. The BAT ICO contract employed this strategy.\n\nThis can be unnecessary if contracts aren't particularly concerned with miner manipulations of the block timestamp, but it is something to be aware of when developing contracts.\n\n\n\n### Equation \n\n\u003cimg src=\"https://render.githubusercontent.com/render/math?math=UnixTime%3D(JD%5Bmo%2C%20day%20%2Cyr%5D-2440588)*86400\"\u003e\n\n### UNIX Background\n\n#### time2posix\n\nIEEE Std 1003.1-1988 (`POSIX.1`) legislates that a time_t value of\n536457599 shall correspond to \"Wed Dec 31 23:59:59 GMT 1986.\" This\neffectively implies that POSIX time_t's cannot include leap seconds and,\ntherefore, that the system time must be adjusted as each leap occurs.\n\n#### strftime()\n\nThe C and POSIX standards define for the strftime() function and the\ndate utility a notation for defining date and time representations. Here\nare some examples, of how they can be used to produce ISO 8601 output:\n\n```bash\nformat string \toutput\n%Y-%m-%d \t      1999-12-31\n%Y-%j \t        1999-365\n%G-W%V-%u      \t1999-W52-5\n%H:%M:%S      \t23:59:59\n```\n\n[JSON Schema `date-time`](https://json-schema.org/latest/json-schema-validation.html#RFC3339)\n```bash\ndate --rfc-3339=seconds | sed 's/ /T/'\n\u003e 2021-03-29T19:12:08-07:00\n```\n\n#### TimeZones\n\n```bash\ndate -u +\"%Y-%m-%d %H-%M-%SZ\"\ndate -u +\"%Y-%m-%dT%H:%MZ\"\n```\n\nZ and +00:00 are the same (mostly). For purposes of translating time,\nthey both mean UTC. However England is +00:00 in winter and +01:00 in\nsummer (BST). Z is UTC, while +00:00 is GMT.\n\nGNU `date` `date -I` is the same as ` date +%F`, and `-Iseconds` and\n`Iminutes` also include time with UTC offset.\n\n```bash\ndate +%F # -I or +%Y-%m-%d\ndate +%FT%T%z # -Iseconds or +%Y-%m-%dT%H:%M:%S%z\ndate +%FT%H:%M # -Iminutes or +%Y-%m-%dT%H:%M%z\ndate -u +%FT%TZ\n```\n\n#### Valid ISO 8601 date or time formats\n\n```bash\n20130503T15 (%Y%m%dT%M)\n2013-05 (%Y%m)\n2013-W18 (%Y-W%V)\n2013-W18-5 (%Y-W%V-%u)\n2013W185 (%YW%V%u)\n2013-123 (%Y-%j, ordinal date)\n2013 (%Y)\n1559 (%H%M)\n15 (%H)\n15:59:24+03 (UTC offset doesn't have to include minutes)\n```\n\n```bash\n$ date -u -Iseconds\n$ date -u '+%Y-%m-%dT%k:%M:%S%z'\n```\n\n#### Daylight Savings Changes\n\n| **From**                   | **To**                  | **On**                     | **At**                      | **Action**  | \\*\\*\\*\\*                   |\n| -------------------------- | ----------------------- | -------------------------- | --------------------------- | ----------- | -------------------------- |\n| 1918                       | 1919                    | last Sunday                | in March                    | 02:00 local | go to daylight saving time |\n| in October                 | return to standard time |                            |                             |             |                            |\n| 1942 only                  | February 9th            | go to “war time”           |                             |             |                            |\n| 1945 only                  | August 14th             | 23:00 UT                   | rename “war time” to “peace |             |                            |\n| time;” clocks don’t change |                         |                            |                             |             |                            |\n| September 30th             | 02:00 local             | return to standard time    |                             |             |                            |\n| 1967                       | 2006                    | last Sunday                | in October                  |             |                            |\n| 1973                       | in April                | go to daylight saving time |                             |             |                            |\n| 1974 only                  | January 6th             |                            |                             |             |                            |\n| 1975 only                  | February 23rd           |                            |                             |             |                            |\n| 1976                       | 1986                    | last Sunday                | in April                    |             |                            |\n| 1987                       | 2006                    | first Sunday               |                             |             |                            |\n| 2007                       | present                 | second Sunday in March     |                             |             |                            |\n| first Sunday in November   | return to standard time |                            |                             |             |                            |\n\n## CalSystems\n\n| **cal_system** | **AverageYear(Days)**   | **ErrorPerYear(Days)** | **ErrorRatio** | **CylcePeriod** | **1-DayShift** | **100-yearError(Days)** |\n| -------------- | ----------------------- | ---------------------- | -------------- | --------------- | -------------- | ----------------------- |\n| 365            | 365                     | 0\\.2422                | 6\\.63 xx10\\-4  | 1,508           | 4\\.129         | 24\\.22                  |\n| Julian         | 365\\.25                 | \\-0\\.0078              | 2\\.14 xx10\\-5  | 46,826          | 128\\.2         | 0\\.78                   |\n| Gregorian      | 365\\.2425               | \\-0\\.0003              | 8\\.2 xx10\\-7   | 1,200,000       | 3,333\\.30      | 0\\.03                   |\n| 4000           | 365\\.24225              | \\-0\\.00005             | 1\\.4 xx10\\-7   | 7,300,000       | 20,000         | 0\\.005                  |\n| 2//900         | 365\\.2422               | \\-0\\.000022            | 6\\.1 xx10\\-8   | 16,000,000      | 45,000         | 0\\.002                  |\n| Jalaali        | 365\\.242424             | \\-0\\.000224            | 6\\.1 xx10\\-7   | 1,600,000       | 4,460          | 0\\.02                   |\n| 31//128        | 365\\.24218750 \\.0000125 | 0 \\.0000125            | 3\\.4 xx10\\-8   | 29,000,000      | 80,000         | 0\\.001                  |\n\n## Seconds\n\n| **Layman time**               | **Seconds** |\n| ----------------------------- | ----------- |\n| 1 minute                      | 60          |\n| 5 minutes                     | 300         |\n| 10 minutes                    | 600         |\n| 30 minutes                    | 1800        |\n| 1 hour                        | 3600        |\n| 2 hours                       | 7200        |\n| 4 hours                       | 14400       |\n| 6 hours                       | 21600       |\n| 8 hours                       | 28800       |\n| 12 hours                      | 43200       |\n| 1 day                         | 86400       |\n| 2 days                        | 172800      |\n| 3 days                        | 259200      |\n| 4 days                        | 345600      |\n| 5 days                        | 432000      |\n| 6 days                        | 518400      |\n| 1 week                        | 604800      |\n| 2 weeks                       | 1209600     |\n| 4 weeks                       | 2419200     |\n| 1 month \\(30 days\\)           | 2592000     |\n| 1 month \\(avg\\. 30\\.44 days\\) | 2629743     |\n| 1 month \\(31 days\\)           | 2678400     |\n| 1 year \\(365 days\\)           | 31536000    |\n| 1 year \\(avg\\. 365\\.24 days\\) | 31556926    |\n| leap year \\(366 days\\)        | 31622400    |\n\n## UNIX\n\n| **Regular date** | **Unix timestampGMT/UTC** |\n| ---------------- | ------------------------- |\n| 1930, January 1  | \\-1262304000              |\n| 1931, January 1  | \\-1230768000              |\n| 1932, January 1  | \\-1199232000              |\n| 1933, January 1  | \\-1167609600              |\n| 1934, January 1  | \\-1136073600              |\n| 1935, January 1  | \\-1104537600              |\n| 1936, January 1  | \\-1073001600              |\n| 1937, January 1  | \\-1041379200              |\n| 1938, January 1  | \\-1009843200              |\n| 1939, January 1  | \\-978307200               |\n| 1940, January 1  | \\-946771200               |\n| 1941, January 1  | \\-915148800               |\n| 1942, January 1  | \\-883612800               |\n| 1943, January 1  | \\-852076800               |\n| 1944, January 1  | \\-820540800               |\n| 1945, January 1  | \\-788918400               |\n| 1946, January 1  | \\-757382400               |\n| 1947, January 1  | \\-725846400               |\n| 1948, January 1  | \\-694310400               |\n| 1949, January 1  | \\-662688000               |\n| 1950, January 1  | \\-631152000               |\n| 1951, January 1  | \\-599616000               |\n| 1952, January 1  | \\-568080000               |\n| 1953, January 1  | \\-536457600               |\n| 1954, January 1  | \\-504921600               |\n| 1955, January 1  | \\-473385600               |\n| 1956, January 1  | \\-441849600               |\n| 1957, January 1  | \\-410227200               |\n| 1958, January 1  | \\-378691200               |\n| 1959, January 1  | \\-347155200               |\n| 1960, January 1  | \\-315619200               |\n| 1961, January 1  | \\-283996800               |\n| 1962, January 1  | \\-252460800               |\n| 1963, January 1  | \\-220924800               |\n| 1964, January 1  | \\-189388800               |\n| 1965, January 1  | \\-157766400               |\n| 1966, January 1  | \\-126230400               |\n| 1967, January 1  | \\-94694400                |\n| 1968, January 1  | \\-63158400                |\n| 1969, January 1  | \\-31536000                |\n| 1970, January 1  | 0                         |\n| 1971, January 1  | 31536000                  |\n| 1972, January 1  | 63072000                  |\n| 1973, January 1  | 94694400                  |\n| 1974, January 1  | 126230400                 |\n| 1975, January 1  | 157766400                 |\n| 1976, January 1  | 189302400                 |\n| 1977, January 1  | 220924800                 |\n| 1978, January 1  | 252460800                 |\n| 1979, January 1  | 283996800                 |\n| 1980, January 1  | 315532800                 |\n| 1981, January 1  | 347155200                 |\n| 1982, January 1  | 378691200                 |\n| 1983, January 1  | 410227200                 |\n| 1984, January 1  | 441763200                 |\n| 1985, January 1  | 473385600                 |\n| 1986, January 1  | 504921600                 |\n| 1987, January 1  | 536457600                 |\n| 1988, January 1  | 567993600                 |\n| 1989, January 1  | 599616000                 |\n| 1990, January 1  | 631152000                 |\n| 1991, January 1  | 662688000                 |\n| 1992, January 1  | 694224000                 |\n| 1993, January 1  | 725846400                 |\n| 1994, January 1  | 757382400                 |\n| 1995, January 1  | 788918400                 |\n| 1996, January 1  | 820454400                 |\n| 1997, January 1  | 852076800                 |\n| 1998, January 1  | 883612800                 |\n| 1999, January 1  | 915148800                 |\n| 2000, January 1  | 946684800                 |\n| 2001, January 1  | 978307200                 |\n| 2002, January 1  | 1009843200                |\n| 2003, January 1  | 1041379200                |\n| 2004, January 1  | 1072915200                |\n| 2005, January 1  | 1104537600                |\n| 2006, January 1  | 1136073600                |\n| 2007, January 1  | 1167609600                |\n| 2008, January 1  | 1199145600                |\n| 2009, January 1  | 1230768000                |\n| 2010, January 1  | 1262304000                |\n| 2011, January 1  | 1293840000                |\n| 2012, January 1  | 1325376000                |\n| 2013, January 1  | 1356998400                |\n| 2014, January 1  | 1388534400                |\n| 2015, January 1  | 1420070400                |\n| 2016, January 1  | 1451606400                |\n| 2017, January 1  | 1483228800                |\n| 2018, January 1  | 1514764800                |\n| 2019, January 1  | 1546300800                |\n| 2020, January 1  | 1577836800                |\n| 2021, January 1  | 1609459200                |\n| 2022, January 1  | 1640995200                |\n| 2023, January 1  | 1672531200                |\n| 2024, January 1  | 1704067200                |\n| 2025, January 1  | 1735689600                |\n| 2026, January 1  | 1767225600                |\n| 2027, January 1  | 1798761600                |\n| 2028, January 1  | 1830297600                |\n| 2029, January 1  | 1861920000                |\n| 2030, January 1  | 1893456000                |\n| 2031, January 1  | 1924992000                |\n| 2032, January 1  | 1956528000                |\n| 2033, January 1  | 1988150400                |\n| 2034, January 1  | 2019686400                |\n| 2035, January 1  | 2051222400                |\n| 2036, January 1  | 2082758400                |\n| 2037, January 1  | 2114380800                |\n| 2038, January 1  | 2145916800                |\n\n\n## Time Stamp Formats \n\n **imestamp Format**           | **Example**                                            \n-------------------------------|--------------------------------------------------------\n yyyy-MM-dd'T'HH:mm:ss*SSSZZZZ | 2018-08-20'T'13:20:10*633+0000                         \n yyyy MMM dd HH:mm:ss.SSS zzz  | 2017 Mar 03 05:12:41.211 PDT                           \n MMM dd HH:mm:ss ZZZZ yyyy     | Jan 21 18:20:11 +0000 2017                             \n dd/MMM/yyyy:HH:mm:ss ZZZZ     | 19/Apr/2017:06:36:15 -0700                             \n MMM dd, yyyy hh:mm:ss a       | Dec 2, 2017 2:39:58 AM                                 \n MMM dd yyyy HH:mm:ss          | Jun 09 2018 15:28:14                                   \n MMM dd HH:mm:ss yyyy          | Apr 20 00:00:35 2010                                   \n MMM dd HH:mm:ss ZZZZ          | Sep 28 19:00:00 +0000                                  \n MMM dd HH:mm:ss               | Mar 16 8:12:04                                         \n yyyy-MM-dd'T'HH:mm:ssZZZZ     | 2017-10-14T22:11:20+0000                               \n yyyy-MM-dd'T'HH:mm:ss.SSS'Z'  | 2017-07-01T14:59:55.711'+0000'2017-07-01T14:59:55.711Z \n yyyy-MM-dd HH:mm:ss ZZZZ      | 2017-08-19 12:17:55 -0400                              \n yyyy-MM-dd HH:mm:ssZZZZ       | 2017-08-19 12:17:55-0400                               \n yyyy-MM-dd HH:mm:ss,SSS       | 2017-06-26 02:31:29,573                                \n yyyy/MM/dd*HH:mm:ss           | 2017/04/12*19:37:50                                    \n yyyy MMM dd HH:mm:ss.SSS*zzz  | 2018 Apr 13 22:08:13.211*PDT                           \n yyyy MMM dd HH:mm:ss.SSS      | 2017 Mar 10 1:44:20                                    \n yyyy-MM-dd HH:mm:ss,SSSZZZZ   | 2017-03-10 14:30:12,655+0000                           \n yyyy-MM-dd HH:mm:ss.SSS       | 2018-02-27 15:35:20                                    \n yyyy-MM-dd HH:mm:ss.SSSZZZZ   | 2017-03-12 13:11:34.222-0700                           \n yyyy-MM-dd'T'HH:mm:ss.SSS     | 2017-07-22'T'16:28:55.444                              \n yyyy-MM-dd'T'HH:mm:ss         | 2017-09-08'T'03:13:10                                  \n yyyy-MM-dd'T'HH:mm:ss'Z'      | 2017-03-12'T'17:56:22'-0700'                           \n yyyy-MM-dd'T'HH:mm:ss.SSS     | 2017-11-22'T'10:10:15.455                              \n yyyy-MM-dd'T'HH:mm:ss         | 2017-02-11'T'18:31:44                                  \n yyyy-MM-dd*HH:mm:ss:SSS       | 2017-10-30*02:47:33:899                                \n yyyy-MM-dd*HH:mm:ss           | 2017-07-04*13:23:55                                    \n yy-MM-dd HH:mm:ss,SSS ZZZZ    | 11-02-11 16:47:35,985 +0000                            \n yy-MM-dd HH:mm:ss,SSS         | 10-06-26 02:31:29,573                                  \n yy-MM-dd HH:mm:ss             | 10-04-19 12:00:17                                      \n yy/MM/dd HH:mm:ss             | 06/01/22 4:11:05                                       \n yyMMdd HH:mm:ss               | 150423 11:42:35                                        \n yyyyMMdd HH:mm:ss.SSS         | 20150423 11:42:35.173                                  \n MM/dd/yy*HH:mm:ss             | 08/10/11*13:33:56                                      \n MM/dd/yyyy*HH:mm:ss           | 11/22/2017*05:13:11                                    \n MM/dd/yyyy*HH:mm:ss*SSS       | 05/09/2017*08:22:14*612                                \n MM/dd/yy HH:mm:ss ZZZZ        | 04/23/17 04:34:22 +0000                                \n MM/dd/yyyy HH:mm:ss ZZZZ      | 10/03/2017 07:29:46 -0700                              \n HH:mm:ss                      | 11:42:35                                               \n HH:mm:ss.SSS                  | 11:42:35                                               \n HH:mm:ss,SSS                  | 11:42:35,173                                           \n dd/MMM HH:mm:ss,SSS           | 23/Apr 11:42:35,173                                    \n dd/MMM/yyyy:HH:mm:ss          | 23/Apr/2017:11:42:35                                   \n dd/MMM/yyyy HH:mm:ss          | 23/Apr/2017 11:42:35                                   \n dd-MMM-yyyy HH:mm:ss          | 23-Apr-2017 11:42:35                                   \n dd-MMM-yyyy HH:mm:ss.SSS      | 23-Apr-2017 11:42:36                                   \n dd MMM yyyy HH:mm:ss          | 23 Apr 2017 11:42:35                                   \n dd MMM yyyy HH:mm:ss*SSS      | 23 Apr 2017 10:32:35*311                               \n MMdd_HH:mm:ss                 | 0423_11:42:35                                          \n MMdd_HH:mm:ss.SSS             | 0423_11:42:35.883                                      \n MM/dd/yyyy hh:mm:ss a:SSS     | 8/5/2011 3:31:18 AM:234                                \n MM/dd/yyyy hh:mm:ss a         | 9/28/2011 2:23:15 PM                                   \n\n## Time Stamp Conventions\n\n| **Token** | **Date or Time Component**                                            | **Example**      |\n|-----------|-----------------------------------------------------------------------|------------------|\n| yyyy      | 4-digit year                                                          | 2012; 2016       |\n| yy        | 2-digit year                                                          | 12; 16           |\n| MMM       | 3-character month                                                     | Jan; Mar; Dec    |\n| MM        | 1- or 2-digit month (in a year)                                       | 1; 01; 9; 09; 12 |\n| dd        | 1- or 2-digit day (in a month)                                        | 1; 01; 16; 30    |\n| a         | AM/PM (case insensitive)                                              | AM; PM; am; pm   |\n| HH        | 1- or 2-digit hour (in a day, 0-23)                                   | 2; 02; 14; 23    |\n| hh        | 1- or 2-digit hour (in a day, 1-12 with AM/PM)                        | 2; 02; 11; 12    |\n| mm        | 1- or 2-digit minute (in an hour)                                     | 8; 08; 55        |\n| ss        | 1- or 2-digit second (in a minute)                                    | 5; 05; 35        |\n| SSS       | 1-3 digit subsecond or millisecond (in decimal)                       | 4; 58; 944       |\n| zzz       | 3- letter time zone                                                   | UTC; PST; EDT    |\n| ZZZZ      | RFC 822 time zone                                                     | -0900; +0500     |\n| Z'        | Literal Z character                                                   | Z                |\n| T'        | Literal T character                                                   | T                |\n| epoch     | 10, 13, 16, 19 digit timestamp with optional . (dot) after 10 digits. | 1496756807       |\n\n\n## Julian-Gregorian Adoption Dates\n\n|                                                                                               Country                                                                                              |                                                           End Julian Calendar                                                           |                                                            Begin Gregorian Calendar                                                           |\n|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------------:|\n| Albania                                                                                                                                                                                            |                                                                                                                                Dec 1912 |                                                                                                                                      Dec 1912 |\n| Austria\u003cbr\u003e Tyrol\u003cbr\u003e Carinthia, Styria                                                                                                                                                            | Oct 5, 1583\u003cbr\u003eDec 14, 1583                                                                                                             | Oct 16,1583\u003cbr\u003eDec 25, 1583                                                                                                                   |\n| Belgium\u003cbr\u003e Spanish Provinces\u003cbr\u003e Liege                                                                                                                                                            | Dec 21, 1582\u003cbr\u003eFeb 10,1583                                                                                                             | Jan 1, 1583\u003cbr\u003eFeb 21,1583                                                                                                                    |\n| Bulgaria                                                                                                                                                                                           |                                                                                                                             Nov 1, 1915 |                                                                                                                                  Nov 14, 1915 |\n| China                                                                                                                                                                                              |                                                                                                                            Dec 18, 1911 |                                                                                                                                   Jan 1, 1912 |\n| Canada\u003cbr\u003e British Colonies\u003cbr\u003e Nova Scotia                                                                                                                                                        | Sep 2, 1752\u003cbr\u003eSep 2, 1752                                                                                                              | Sep 14, 1752\u003cbr\u003eSep 14, 1752                                                                                                                  |\n| Czech Republic - Bohemia / Moravia                                                                                                                                                                 |                                                                                                                             Jan 6, 1584 |                                                                                                                                  Jan 17, 1584 |\n| Denmark\u003cbr\u003e Faero Islands                                                                                                                                                                          | Feb 18, 1700\u003cbr\u003eNov 16, 1700                                                                                                            | March 1,1700\u003cbr\u003eNov 28, 1700                                                                                                                  |\n| Egypt                                                                                                                                                                                              |                                                                                                                                    1875 |                                                                                                                                          1875 |\n| Estonia                                                                                                                                                                                            |                                                                                                                             Feb 1, 1918 |                                                                                                                                  Feb 15, 1918 |\n| Finland (part of Sweden)                                                                                                                                                                           |                                                                                                                            Feb 17, 1753 |                                                                                                                                 March 1, 1753 |\n| France \u0026 Colonies\u003cbr\u003e Alsace\u003cbr\u003e Strasbourg                                                                                                                                                        | Dec 9, 1582\u003cbr\u003e1648\u003cbr\u003eFeb 5, 1682                                                                                                      | Dec 20, 1582\u003cbr\u003e1648\u003cbr\u003eFeb 16,1682                                                                                                           |\n| Germany, Catholic Regions\u003cbr\u003e Augsburg\u003cbr\u003e Baden\u003cbr\u003e Bavaria\u003cbr\u003e Cologne\u003cbr\u003e Julich\u003cbr\u003e Mainz\u003cbr\u003e Munster, Strasbourg\u003cbr\u003e Trier\u003cbr\u003e Wurzburg                                                       | Feb 13, 1583\u003cbr\u003eNov 16, 1583\u003cbr\u003eOct 5, 1583\u003cbr\u003eNov 3, 1583\u003cbr\u003eNov 2, 1583\u003cbr\u003eNov 11, 1583\u003cbr\u003eNov 16, 1583\u003cbr\u003eOct 4, 1583\u003cbr\u003eNov 4, 1583 | Feb 24, 1583\u003cbr\u003eNov 27, 1583\u003cbr\u003eNov 16, 1583\u003cbr\u003eNov 14, 1583\u003cbr\u003eNov 13, 1583\u003cbr\u003eNov 22, 1583\u003cbr\u003eNov 27, 1583\u003cbr\u003eOct, 15, 1583\u003cbr\u003eNov 15, 1583 |\n| Germany, Protestant Regions\u003cbr\u003e Hildesheim\u003cbr\u003e Kurland\u003cbr\u003e Minden\u003cbr\u003e Neuburg\u003cbr\u003e Osnabruck\u003cbr\u003e Paderborn\u003cbr\u003e Prussia\u003cbr\u003e Westphalia\u003cbr\u003e All Others                                                | Mar 15, 1631\u003cbr\u003e1617\u003cbr\u003eFeb 1, 1668\u003cbr\u003eDec 13, 1615\u003cbr\u003e1624\u003cbr\u003eJune 16, 1585\u003cbr\u003eAug 22, 1610\u003cbr\u003eJuly 1, 1584\u003cbr\u003eFeb 18, 1700            | March 26, 1631\u003cbr\u003e1617\u003cbr\u003eFeb 12, 1668\u003cbr\u003eDec 24, 1615\u003cbr\u003e1624\u003cbr\u003eJuly 27, 1585\u003cbr\u003eSept 2, 1610\u003cbr\u003eJuly 12, 1584\u003cbr\u003eMarch 1, 1700             |\n| Great Britain \u0026 colonies                                                                                                                                                                           | Sept 2, 1752                                                                                                                            | Sept 14, 1752                                                                                                                                 |\n| Greece                                                                                                                                                                                             | Sept 14, 1916                                                                                                                           | Sept 28, 1916                                                                                                                                 |\n| Holy Roman Empire                                                                                                                                                                                  |                                                                                                                             Jan 6, 1584 |                                                                                                                                  Jan 17, 1584 |\n| Hungary\u003cbr\u003e Transylvania                                                                                                                                                                           | Oct 21, 1587\u003cbr\u003eDec 14, 1590                                                                                                            | Nov 1, 1587\u003cbr\u003eDec 25, 1590                                                                                                                   |\n| Iceland                                                                                                                                                                                            |                                                                                                                            Nov 16, 1700 |                                                                                                                                  Nov 28, 1700 |\n| Ireland                                                                                                                                                                                            | Sept 2, 1752                                                                                                                            | Sept 14, 1752                                                                                                                                 |\n| Italy                                                                                                                                                                                              |                                                                                                                              Oct 4,1582 |                                                                                                                                  Oct 15, 1582 |\n| Japan                                                                                                                                                                                              |                                                                                                                                    1873 |                                                                                                                                          1873 |\n| Latvia                                                                                                                                                                                             |                                                                                                                             Feb 1, 1918 |                                                                                                                                  Feb 15, 1918 |\n| Lithuania                                                                                                                                                                                          |                                                                                                                             Feb 1, 1918 |                                                                                                                                  Feb 15, 1918 |\n| Moravia (Czech Republic)                                                                                                                                                                           |                                                                                                                             Jan 6, 1584 |                                                                                                                                  Jan 17, 1584 |\n| The Netherlands\u003cbr\u003e Holland, North Brabant\u003cbr\u003e Gelderland, Zutphen\u003cbr\u003e Utrecht, Overijssel\u003cbr\u003e Friesland, Groningen\u003cbr\u003e Drente                                                                     | Dec 21, 1582\u003cbr\u003eJune 30, 1700\u003cbr\u003eNov 30, 1700\u003cbr\u003eDec 31, 1700\u003cbr\u003eApril 30, 1701                                                         | Jan 1, 1583\u003cbr\u003eJuly 7, 1700\u003cbr\u003eDec 12, 1700\u003cbr\u003eJan 12, 1701\u003cbr\u003eMay 12, 1701                                                                   |\n| Norway                                                                                                                                                                                             |                                                                                                                            Feb 18, 1700 |                                                                                                                                 March 1, 1700 |\n| Poland\u003cbr\u003e Silesia                                                                                                                                                                                 | Oct 4, 1582\u003cbr\u003eJan 12, 1584                                                                                                             | Oct 15, 1582\u003cbr\u003eJan 23, 1584                                                                                                                  |\n| Portugal                                                                                                                                                                                           |                                                                                                                             Oct 4, 1582 |                                                                                                                                  Oct 15, 1582 |\n| Romania\u003cbr\u003e Transylvania                                                                                                                                                                           | March 31, 1919\u003cbr\u003eDec 14, 1590                                                                                                          | April 14, 1919\u003cbr\u003eDec 25, 1590                                                                                                                |\n| Russia                                                                                                                                                                                             |                                                                                                                             Jan 31,1918 |                                                                                                                                  Feb 14, 1918 |\n| Spain\u003cbr\u003e American Colonies                                                                                                                                                                        | Oct 4, 1582\u003cbr\u003e1584                                                                                                                     | Oct 15, 1582\u003cbr\u003e1584                                                                                                                          |\n| Sweden                                                                                                                                                                                             |                                                                                                                            Feb 17, 1753 |                                                                                                                                 March 1, 1753 |\n| Switzerland\u003cbr\u003e Catholic Cantons - Lucern, Uri, Schwyz, Zug, Freiburg, Solothurn\u003cbr\u003e Wallis\u003cbr\u003e Protestant - Zurich, Bern, Basel, Schaffhouse, Geneva, Thurgovia\u003cbr\u003e Appenzell, Glarus, St. Gallen | Jan 11, 1584\u003cbr\u003eJan 11, 1584\u003cbr\u003eFeb 28, 1655\u003cbr\u003eDec 31, 1700\u003cbr\u003eDec 31, 1700\u003cbr\u003e1724                                                    | Jan 22, 1584\u003cbr\u003eJan 22, 1584\u003cbr\u003eMarch 11, 1655\u003cbr\u003eJan 12, 1701\u003cbr\u003eJan 12, 1701\u003cbr\u003e1724                                                        |\n| Turkey                                                                                                                                                                                             |                                                                                                                                    1927 |                                                                                                                                          1927 |\n| United States\u003cbr\u003e British Colonies\u003cbr\u003e Spanish Colonies\u003cbr\u003e Alaska                                                                                                                                 | Sept 2, 1752\u003cbr\u003e1584\u003cbr\u003eOct 5, 1867                                                                                                     | Sept 14, 1752\u003cbr\u003e1584\u003cbr\u003eOct 18, 1867                                                                                                         |\n| Yugoslavia                                                                                                                                                                                         |                                                                                                                           March 4, 1919 |                                                                                                                                March 18, 1919 |\n\n\n### References\n\n[https://pumas.nasa.gov/files/04_21_97_1.pdf](https://pumas.nasa.gov/files/04_21_97_1.pdf)\n\u003cbr\u003e\n[Timestamps, Time-Zones, Time-Ranges, and Date-Formats#Timestamp_conventions](https://help.sumologic.com/03Send-Data/Sources/04Reference-Information-for-Sources/Timestamps%2C-Time-Zones%2C-Time-Ranges%2C-and-Date-Formats#Timestamp_conventions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambacha%2Fblockchain-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsambacha%2Fblockchain-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsambacha%2Fblockchain-time/lists"}