{"id":16131129,"url":"https://github.com/nerddiffer/hextime","last_synced_at":"2025-04-06T14:22:44.292Z","repository":{"id":22513063,"uuid":"25853367","full_name":"NerdDiffer/hextime","owner":"NerdDiffer","description":"time in hexadecimal format","archived":false,"fork":false,"pushed_at":"2015-09-12T23:15:22.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T01:07:52.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NerdDiffer.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}},"created_at":"2014-10-28T04:42:22.000Z","updated_at":"2020-12-24T03:34:38.000Z","dependencies_parsed_at":"2022-08-25T02:51:46.561Z","dependency_job_id":null,"html_url":"https://github.com/NerdDiffer/hextime","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fhextime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fhextime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fhextime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NerdDiffer%2Fhextime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NerdDiffer","download_url":"https://codeload.github.com/NerdDiffer/hextime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492864,"owners_count":20947600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-09T22:19:18.115Z","updated_at":"2025-04-06T14:22:44.271Z","avatar_url":"https://github.com/NerdDiffer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hextime\n\nThe time based on powers of 16. See the bottom for usage.\n\n## How do we normally divide units of time?\n\nThese are the seconds, minutes, hours, and days you grew up with. Here's a\na little chart describing how many of a smaller unit fits into a larger unit:\n\n| Number of   | 1 second | 1 minute | 1 hour | 1 day |\n|:-----------:|:--------:|:--------:|:------:|:-----:|\n| seconds in: | 1 | 60 | 3600 | 86400 |\n| minutes in: |   | 1  | 60   | 1440  |\n| hours in:   |   |    | 1    | 24    |\n| days  in:   |   |    |      | 1     |\n\nAs you can see, there are:\n\n* 60 seconds per minute, 3600 seconds per hour, 86400 seconds per day\n* 60 minutes per hour, 1440 minutes per day\n* 24 hours in a day\n\nYou already know this, even if you never thought about it...You count 60\nseconds for 1 minute, 60 minutes for 1 hour.\n\nBut does it seem a little arbitrary to have to count 24 hours for 1 day?\nMaybe it does...Most of us grew up with that system and we accept it.\n\nIf you like numbers and/or the uneven partitioning of the day bothers you,\nread on.\n\n## What is hexadecimal time?\n\nHexadecimal time is an alternative way of measuring time, based on 16.\nOne hexadecimal day is equal to one 'regular' day.\n\nIn hexadecimal time, the proportions of a smaller division of time to a larger\nunit of time is based on 16. Here, they are represented, decimally:\n\n| Number of | 1 hex second | 1 hex minute | 1 hex hour | 1 hex day |\n|:---------:|:------------:|:------------:|:----------:|:---------:|\n| hex seconds in: | 1 | 16 | 4096 | 65536 |\n| hex minutes in: |   | 1  | 256  | 4096  |\n| hex hours in:   |   |    | 1    | 16    |\n| hex days  in:   |   |    |      | 1     |\n\n*Here are the relationships, when you convert the above values to base-16*\n\n| Number of | 1 hex second | 1 hex minute | 1 hex hour | 1 hex day |\n|:---------:|:------------:|:------------:|:----------:|:---------:|\n| hex seconds in: | 1 | 10 | 1000 | 10000 |\n| hex minutes in: |   | 1  | 100  | 1000  |\n| hex hours in:   |   |    | 1    | 10    |\n| hex days  in:   |   |    |      | 1     |\n\nPretty cool, huh?\n\n##### Read more about hexadecimal time\n\n* [Wikipedia page](https://en.wikipedia.org/wiki/Hexadecimal_time)\n* [Intuitor](http://www.intuitor.com/hex/hexclock.html)\n\n---\n\n## Installation\n\n`npm install hextime`\n\n## Usage\n\nAll numbers are expressed in base-10.\n\n#### Convert from regular units of time to hexadecimal units of time\n\n```javascript\nvar fromRegular = require('hextime').fromRegular;\n\n// convert regular seconds to a hexadecimal seconds\nfromRegular.toHexSec(86400);\n\n// convert regular minutes to hexadecimal minutes\nfromRegular.toHexMin(1440);\n\n// convert regular hours a hexadecimal hours\nfromRegular.toHexHour(24);\n```\n\n#### Convert from hexadecimal units of time to regular units of time\n\n```javascript\nvar fromHexadecimal = require('hextime').fromHexadecimal;\n\n// convert hexadecimal seconds to a regular seconds\nfromHexadecimal.toRegSec(42);\n\n// convert hexadecimal minutes to a regular minutes\nfromHexadecimal.toRegMin(42);\n\n// convert hexadecimal hours a regular hours\nfromHexadecimal.toRegHour(16);\n```\n\n#### Use `HexTime` like a class\n\n```javascript\nvar HexTime = require('hextime').HexTime;\n\n// convert from regular time to hexadecimal time by passing it the\n// regular time as a string\nHexTime.convertToHexTime('12:00:00');\n\n// get hexadecimal hours from hexadecimal seconds\nHexTime.getHHfromSS(65536);\n// get hexadecimal days from hexadecimal minutes\nHexTime.getDDfromMM(4096);\n// get hexadecimal days from hexadecimal seconds\nHexTime.getDDfromSS(65536);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fhextime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerddiffer%2Fhextime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerddiffer%2Fhextime/lists"}