Giter Site home page Giter Site logo

base10x60timestamp's Introduction

Utility to deal with timestamps, including a timestamp format of my own creation: "base10x60timestamp".

The format:

YYYYMMDDthms
Digits Description
YYYY year, base10 digits
MM month, base10 digits
DD date, base10 digits
t timezone ("-" for UTC, which is the only valid choice right now)
h hours, base60 digit (RFC 1924 style) (0-N which is 0-23)
m minutes, base60 digit (0-x, which is 0-59)
s seconds, base60 digit (0-x, which is 0-59)

Example:

  • 20180720-3mf -> 2018-07-20T03:48:41+00:00

Just the time portion from the example:

  • 3mf -> 03:48:41

"base60" digit is compatible with the RFC 1924 base85 format:

  • 0-9: 0-9
  • A-Z: 10-35
  • a-x: 36-59

This makes the date timestamps sort reasonably on a system supporting lower ascii (UTF-7). base60 makes the time compact but still marginally readable.

Having "-" represent "UTC" reserves that character in a readable way. It's possible that future versions might use other characters to represent a timezone offset.

epoch

epoch is a utility to convert to/from seconds from epoch.

usage: epoch [-h] [-b] [-u] [-i] [timestr]

Convert string to or from epoch (as appropriate)

positional arguments:
  timestr           string to convert

optional arguments:
  -h, --help        show this help message and exit
  -b, --base60time  use YYMMDD and base60 time
  -u, --utc         show UTC
  -i, --integer     round off to nearest second

epoch is only tangentally related to base60time, because when I started using base10x60timestamps, this was the utility I added it to.

base10x60timestamp's People

Contributors

robla avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.