0.2.1 • Published 1 year ago

metatime v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Metatime

Metatime is a new way to keep track of and account for time optimised for the digital age. This repository is both a specification of the Metatime time keeping system as well as a reference implementation in javascript.

Motivation and background

In our increasingly globalized world, decentralized and remote teams are a reality in many industries, particularly in tech and web3. Also, with the advent of the metaverse(s) it is becoming more and more common place to "meet" online across geographic boundaries and timezones. All of this holds a number of challenges, one of which is how we collectively think about and account for time.

Lost in timezones

Today, it is notoriously difficult to schedule meetings of distributed teams across timezones or announce an event or meetup in the metaverse as you always have to factor the timezone differences. Generally we use the UTC timesystem that comes with timezones that are either n hours ahead or behind the universal time or UTC (for example Switzerland is UTC+1, San Francisco is UTC-8 and Singapore UTC+8). Generally, a timezone is just describing a deviation from UTC, either positive (UTC+n) or negative (UTC-n).

Complicated calculations

Let's say Bob has scheduled an online meeting at 2pm and is based in Manhatten. NYC is in timezone UTC-5. Now let's assume Alice is joining from Singapore. She needs to manually add 8 + 5 hours to understand when to login to the meeting. How does she know to add 13 hours? She needs 3 data points: the meeting time, the meeting's timezone/deviation from UTC and her own timezone/deviation from UTC. In addition to the data she needs the knowledge how to calculate. This is all cumbersome and error prone. And besides the reading of the meeting time must feel a bit unnatural for Alice as in this example the actual meeting time in Singapore's timezone (UTC+8) is actually 1am in the morning on the next day! That is a very different time from 2pm in the afternoon as the meeting invite suggests.

UTC for all

One way to solve this issue and make it more human-readable would be to ditch the concept of timezones and just use UTC around the globe. The problem with this solution is, that most of us have gotten used to certain universal conventions such as 6am - 9am are the morning hours, when we for example start work. Adopting UTC would most likely mean, that we would use 2 time calibrations in parallel: UTC for international meetings and the metaverse, and our local timezone to plan our days.

Metatime as an alternative

This is where Metatime as an entirely new time counting system comes in. It is universal without timezones and in addition also more human-readable by making use of the familiar decimal instead of the sexagenary numeral system. Metatime is an adaption and simplifcation of some of the older decimal time systems that originated in China and the French revolution.

Specification

Metatime divides up a Gregorian Calendar day with the decimal numeral system as follows:

  • 1 day is divided into 100 clicks
  • 1 click is divided into 100 ticks
  • 1 tick is divided into 100 blicks

Each Metatime units length can be expressed in milliseconds as follows:

  • 1 click equals exactly 864,000 milliseconds
  • 1 tick equals exactly 8,640 milliseconds
  • 1 blick equals exactly 86.40 milliseconds
dayclicksticksblicks
day110010,0001,000,000
click0.01110010,000
tick0.00010.011100
blick0.0000010.00010.011

Formatting

As a convention metatime uses a full stop to separate its different units clicks and ticks. The full stop makes it easier to differentiate Metatime form UTC time which commonly uses colons. Metatime by convention is noted from the largest to the smallest unit: days, clicks, ticks and lastly blicks.

In its most basic form metatime is stylized as follows:

clicks.ticks (for example: 20.95 which can be read as 20 clicks and 95 ticks)

In some scenarios (for example when working across different UTC timezones, see section about timezones) it is useful to also show the day of the current month.

days.clicks.ticks (for example 08.20.95 which can be read as 8th day of the month at 20 clicks and 95 ticks)

In scenarios such as a stop clock it is useful to also add in blicks.

days.clicks.ticks.blicks (for example 08.20.95.80 which can be read as 8th day of the month at 20 clicks, 95 ticks and 80 blicks)

Instead of the full stop separating the units you can also use unit descriptors. As a convention these are:

  • dx for days
  • cx for clicks
  • tx for ticks
  • bx for blicks

Abbreviations are kept in all lower caps.

8dx 20cx 95tx

If clicks and ticks are being displayed together, separators can be ommited altogether. This essentially gives a reading of the total number of ticks that passed on a any given day. However, the notation including the full stop is preferred.

20.95 becomes 2095 (20 clicks and 95 ticks or 2095 ticks)

Comparison to base 60 time

Because 1 Metatime blick is equal to 86.4 milliseconds, 100 clicks 100 ticks 100 blicks is equal to 86,400,000 milliseconds which is the same as 24 hours 60 minutes 60 seconds * 1000 milliseconds. Therefore, Metatime is compatible with the sexagenary UTC time system as both share the same largest unit, a Gregorian day. The conversion from one system to the other works out as follows:

ClicksTicksBlicksMilliseconds
day10010,0001,000,00086,400,000
hour~4.167~416.667~41,666.6673,600,000
minute~0.06944~6.944~694.44460,000
second~0.001157~0.1157~11.57407401,000
dayshoursminutessecondsmilliseconds
Click0.010.2414.4864864,000
Tick0.00010.00240.1448.648,640
Blick0.0000010.0000240.001440.086486.4

For convenience and to make transition to Metatime easier it is recommended to compare the two time systems as follows:

  • 1 click equals 14 minutes and 24 seconds (14.4 minutes)
  • 1 tick represent about 9 seconds (8.64 seconds)
  • 10 clicks represent about 2 and a half hours (2.4 hours)
  • 10 ticks represent about 1 and a half minutes (1.44 minutes)
  • 25 clicks equal 6 hours (4 6 hours = 24 hours = 1 day = 4 25 clicks = 100 clicks = 1 day)

Timezones

Metatime is universal and does not have any timezones at all. It uses UTC-0 midnight as a base. Therefore, UTC 00:00:00 is equal to 00.00 in Metatime. The following table compares metatime to UTC time:

UTCClicksTicks
00:00:0000
00:14:241100
00:28:482200
00:43:123300
00:57:364400
01:12:005500
01:26:246600
01:40:487700
01:55:128800
02:09:369900
02:24:00101000
02:38:24111100
02:52:48121200
03:07:12131300
03:21:36141400
03:36:00151500
03:50:24161600
04:04:48171700
04:19:12181800
04:33:36191900
04:48:00202000
05:02:24212100
05:16:48222200
05:31:12232300
05:45:36242400
06:00:00252500
06:14:24262600
06:28:48272700
06:43:12282800
06:57:36292900
07:12:00303000
07:26:24313100
07:40:48323200
07:55:12333300
08:09:36343400
08:24:00353500
08:38:24363600
08:52:48373700
09:07:12383800
09:21:36393900
09:36:00404000
09:50:24414100
10:04:48424200
10:19:12434300
10:33:36444400
10:48:00454500
11:02:24464600
11:16:48474700
11:31:12484800
11:45:36494900
12:00:00505000
12:14:24515100
12:28:48525200
12:43:12535300
12:57:36545400
13:12:00555500
13:26:24565600
13:40:48575700
13:55:12585800
14:09:36595900
14:24:00606000
14:38:24616100
14:52:48626200
15:07:12636300
15:21:36646400
15:36:00656500
15:50:24666600
16:04:48676700
16:19:12686800
16:33:36696900
16:48:00707000
17:02:24717100
17:16:48727200
17:31:12737300
17:45:36747400
18:00:00757500
18:14:24767600
18:28:48777700
18:43:12787800
18:57:36797900
19:12:00808000
19:26:24818100
19:40:48828200
19:55:12838300
20:09:36848400
20:24:00858500
20:38:24868600
20:52:48878700
21:07:12888800
21:21:36898900
21:36:00909000
21:50:24919100
22:04:48929200
22:19:12939300
22:33:36949400
22:48:00959500
23:02:24969600
23:16:48979700
23:31:12989800
23:45:36999900

Since Metatime does not have any timezones it can be useful to define time cycles instead. This is, however, only a recommendation and not a formal specification. For example, an organization could define its online meeting window as a cycle from 45-65 clicks. Or a worker may define his sleep/"do not disturb" cycle from 5 to 30 clicks. This has the advantage that time is always absolute, 50 clicks is 50 clicks anywhere on the globe but cycles may differ. While people in the US might go to sleep around 20 clicks, in Asia they are at work already at the same time. Around 60 clicks, however, Asians might start their sleep cycles while Americans are on their commute to work.

Reference library

This is a tiny and simplistic implementation of Metatime in Javascript. It makes use of Javascript's built in Datetime functionality and dynamically calculates the Metatime.

Installation

To use the library in the browser import it from the unpkg CDN. This will expose a Metatime object in the global scope.

<script src="https://unpkg.com/metatime/lib/browser.js"></script>

<script>
// A global object Metatime is available
const time = Metatime.now();
console.log(time) // { days: 8, clicks: 20, ticks: 95, blicks: 99 render: Fn }
</script>

You can also install it on your local machine to use in a custom build process or with Node JS.

npm install metatime --save
// ES6
import { now, clock, stop } from 'metatime';
import * as Metatime from 'metatime'; // import all at once instead

// Node
const Metatime = require('metatime');

Usage

The library exposes 3 methods: now(), clock() and stop().

// Get the current metatime
const now = Metatime.now();
console.log(now); // { days: 8, clicks: 20, ticks: 95, blicks: 99, render: Fn }

// Display the time as a formatted string
const now = Metatime.now();
console.log(now.render()); // 20.95

// Format the rendered string
console.log(now.render({ display: 'd.cc.tt', style: 'units' })) // 8dx 20cx 95tx 99bx

// Setup an interval that streams the time
const clock = Metatime.clock(time => {
    console.log(time); // { days: 8, clicks: 20, ticks: 95, blicks: 99 render: Fn }
});

// Stopping the interval
const button = document.querySelector('button');
button.addEventListener('click', e => {
    Metatime.stop(clock);
});

Reference

Metatime

Main object that contains 3 methods now(), clock() and stop().

Metatime.now()

A method that returns an object with the metatime.

Metatime.now([MetatimeConfig])

const now = Metatime.now();
console.log(now); // { days: 8, clicks: 20, ticks: 95, blicks: 99, render: Fn }
Parameters
  • Optional {Object} of the type MetatimeConfig to pass configuration options

Metatime.clock()

A method that returns an interval overload.

Metatime.clock(Function, [MetatimeConfig])

const options = { precision: 1000 };
const clock = Metatime.clock(time => {
    console.log(time); // { days: 8, clicks: 20, ticks: 95, blicks: 99, render: Fn } ... { days: 8, clicks: 20, ticks: 96, blicks: 00 render: Fn } ... { days: 8, clicks: 20, ticks: 97, blicks: 00, render: Fn } ...
}, options);
Parameters
  • {Function} a callback function that runs on every interval cycle.
    • The callback function gets passed 1 argument, an {Object} of the type MetatimeTime with the current time in metatime format.
  • Optional {Object} of the type MetatimeConfig to pass configuration options

Metatime.stop()

A method that takes a reference to an interval overload and stops it immediately. This is a simple wrapper to the native clearInterval() function for convenience.

Metatime.stop(ref)

Parameters
  • {number} a reference to an active interval overload

MetatimeConfig

An object to set configuration options.

const options = {
    precision: 100
}
Properties
Propertiestypepossible valuesdescription
precision optionalnumber>= 1 (default = 1000)Defines the precision of the clock in milliseconds.

MetatimeInterface

An object that serves as a return value of the metatime now and clock methods.

Properties
Propertiestypepossible valuesdescription
daynumber>= 1The day of the month in UTC timezone
clicksnumber0-99Metatime clicks
ticksnumber0-99Metatime ticks
blicksnumber0-99Metatime blicks
renderFunctionoptional formatting {object} / available properties: display (metatime timestring), style: standard (default), units, bulkyA function that returns the metatime in a formatted string and takes an optional formatting object as an argument

render()

A utility function that is part of the MetatimeInterface and returned by both now() and the clock() callback.

render([formatting: MetatimeFormatting]): string

Parameters
  • Optional {Object} of the type MetatimeFormatting to pass formatting options

MetatimeFormatting

An object that can be passed to the render utility function to format the metatime timestring.

Propertiestypepossible valuesdescription
displaystringDefault value is 'cc.tt'. Accepts any valid metatime timestring that uses a combination 'd' for day, 'c' for clicks, 't' for ticks and 'b' for blicks and a full stop '.' to separate different units. The number of subsequent letters defines the number of forced digits rendered, for example 'cc' will render clicks always in double digit format (for example 09, 10 etc.).A metatime timestring to define the units and digits rendered.
stylestring'standard' (default), 'units', 'bulky'Defines the display style of the rendered string.

License

Copyright 2022 Philipp S. Nueesch

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago