{"id":15211084,"url":"https://github.com/haaleo/vscode-timing","last_synced_at":"2025-10-29T16:31:14.176Z","repository":{"id":42174641,"uuid":"134983876","full_name":"HaaLeo/vscode-timing","owner":"HaaLeo","description":"🕓  VS Code extension to convert timestamps from/to various formats and preview/insert them on demand.","archived":false,"fork":false,"pushed_at":"2023-07-18T20:28:02.000Z","size":2859,"stargazers_count":25,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T01:22:46.807Z","etag":null,"topics":["command-palette","conversion","convert-timestamps","converter","date","duration","epoch","insert","iso","iso8601","momentjs-format","time","time-conversion","timestamp","timestamp-conversion","timing","utc","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HaaLeo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"HaaLeo","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.me/LeoHanisch"]}},"created_at":"2018-05-26T18:02:30.000Z","updated_at":"2024-07-01T14:01:58.000Z","dependencies_parsed_at":"2024-06-20T06:23:17.694Z","dependency_job_id":"6541e66f-9dfe-4276-9e78-edc7eb698837","html_url":"https://github.com/HaaLeo/vscode-timing","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaaLeo%2Fvscode-timing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaaLeo%2Fvscode-timing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaaLeo%2Fvscode-timing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaaLeo%2Fvscode-timing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HaaLeo","download_url":"https://codeload.github.com/HaaLeo/vscode-timing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219857515,"owners_count":16556062,"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":["command-palette","conversion","convert-timestamps","converter","date","duration","epoch","insert","iso","iso8601","momentjs-format","time","time-conversion","timestamp","timestamp-conversion","timing","utc","vscode","vscode-extension"],"created_at":"2024-09-28T08:03:35.677Z","updated_at":"2025-10-29T16:31:08.622Z","avatar_url":"https://github.com/HaaLeo.png","language":"TypeScript","funding_links":["https://github.com/sponsors/HaaLeo","https://www.paypal.me/LeoHanisch","https://www.paypal.me/LeoHanisch/3eur"],"categories":[],"sub_categories":[],"readme":"# VS Code Time Converter \u0026#8212; timing\n\n[![Version](https://vsmarketplacebadge.apphb.com/version/HaaLeo.timing.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=HaaLeo.timing) [![Downloads](https://vsmarketplacebadge.apphb.com/downloads/HaaLeo.timing.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=HaaLeo.timing) [![Ratings](https://vsmarketplacebadge.apphb.com/rating/HaaLeo.timing.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=HaaLeo.timing#review-details) [![Stars](https://img.shields.io/github/stars/HaaLeo/vscode-timing.svg?label=Stars\u0026logo=github\u0026style=flat-square)](https://github.com/HaaLeo/vscode-timing/stargazers)  \n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://raw.githubusercontent.com/HaaLeo/vscode-timing/master/LICENSE.txt) [![Lint, Test, Bundle and Deploy](https://img.shields.io/github/workflow/status/HaaLeo/vscode-timing/Build%2C%20Lint%2C%20Test%20and%20Deploy?label=Build%2C%20Lint%2C%20Test%20and%20Deploy\u0026style=flat-square)](https://github.com/HaaLeo/vscode-timing/actions?query=workflow%3A%22Lint%2C+Test%2C+Bundle+and+Deploy%22) [![Coverage Status](https://img.shields.io/coveralls/github/HaaLeo/vscode-timing?style=flat-square)](https://coveralls.io/github/HaaLeo/vscode-timing)  \n\n\n## Description\n\nThe *timing* extension converts and visualizes a given time to various formats. You can invoke all commands via the command palette ([sample](#simple-conversion)). In addition, you can just hover over an epoch timestamp in the editor to get a human readable preview of that timestamp ([sample](#hover-preview)).\n\nTo view all commands, open the _command palette_ and type _Timing_.\n\nThis extension was inspired by [zodiac403's epoch-time-converter](https://github.com/zodiac403/epoch-time-converter).\n\n\u003e All breaking changes of **v2.0.0** are listed in the [changelog](CHANGELOG.md#changelog)\n\n## Installation\n\n### Via Visual Studio Code\n\n1. Press \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eP\u003c/kbd\u003e to open the _Go to File..._ view\n2. Type `ext install HaaLeo.timing` and press \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n### From VSIX\n\n1. Download the `.vsix` file of the latest [release from GitHub](https://github.com/HaaLeo/vscode-timing/releases)\n2. Run `code --install-extension timing-*.*.*.vsix` in the command line ([reference](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix))\n\n## Features\n\nCurrently this extension is capable to do the following conversions, where the _epoch_ time can be formated in **seconds**, **milliseconds**, **microseconds** or **nanoseconds**, and _custom_ is a localized [momentjs format](https://momentjs.com/docs/#/displaying/format/), that you can specify in the settings or insert during the conversion. Epoch times can be converted to a human readable _timestamp_ or _duration_.  \n\n Source Format| ⟶ | Target Format| Example\n:--|:--:|:-- |:--\nEpoch (s, ms, μs, ns) | ⟶ | ISO 8601 UTC| [Link](#simple-conversion)\nEpoch (s, ms, μs, ns) | ⟶ | ISO 8601 Custom Timezone\nEpoch (s, ms, μs, ns) | ⟶ | ISO 8601 Local\nEpoch (s, ms, μs, ns) | ⟶ | Custom\nEpoch (s, ms, μs, ns) | ⟶ | Custom Format and Timezone\nEpoch (s, ms, μs, ns) | ⟶ | ISO 8601 Duration\nEpoch (s, ms, μs, ns) | ⟶ | Human Readable Duration\nEpoch (s, ms, μs, ns) | ⟶ | Gps Epoch\nISO 8601 Duration | ⟶ | Epoch (s, ms, μs, ns)\nISO 8601 / RFC 2282 | ⟶ | Epoch (s, ms, μs, ns)\nISO 8601 / RFC 2282 | ⟶ | Custom| [Link](#custom-formats)\n\\- | ⟶ | Now as Epoch (s, ms, μs, ns)\n\\- | ⟶ | Now as ISO 8601 UTC\n\\- | ⟶ | Now as ISO 8601 Local| [Link](#current-time)\n\\- | ⟶ | Now as Custom\nCustom | ⟶ | Custom\nCustom | ⟶ | Epoch (s, ms, μs, ns)\nCustom | ⟶ | ISO 8601 UTC\nCustom | ⟶ | ISO 8601 Local\n\nWhether the current selection is [replaced](#insert-converted-time) with the converted time, is indicated by the `timing.insertConvertedTime` setting. When you already [pre-selected](#pre-selection) a valid epoch time, the extension will directly convert this selection instead of asking for your input.\n\nWhen the _epoch time is the **source**_ format of the _timestamp_ conversion its unit is determined by its **digit count**:\n\nMinimum Length| Maximum Length| Used Unit\n:--:|:--:|:--:\n1 | 11| **s**\n12 | 14| **ms**\n15 | 17| **μs**\n18 | 21| **ns**\n\n\u003e**Note**: Those boundaries are set with the `timing.epochConversionBoundaries` setting.\n\nWhen the _epoch time is the **target**_ format of the timestamp conversion you can select its unit during the conversion process.  \n\nWhen the _epoch time is the **source**_ format of the duration conversion you can select its unit during the conversion process.  \n\nFurther the extension shows a [hover preview](#hover-preview) of the converted _timestamp_ and _duration_ when the mouse is moved over a valid epoch time.\n\n## Settings Overview\n\n* `timing.clipboard.readingEnabled`: Indicates whether the extension should try to get the input time from the clipboard instead of asking the user for input.\n* `timing.clipboard.writingEnabled`: Indicates whether the result of the conversion is written to the clipboard. When enabled, no result view will be shown.\n* `timing.customFormats`: An array of custom source/target formats used to convert from/to.\n* `timing.epochConversionBoundaries`: Distinguish when to consider an epoch timestamp's unit as \"seconds\", \"milliseconds\", \"microseconds\" or \"nanoseconds\".\n* `timing.hideResultViewOnEnter`: Indicates whether the result view is hidden when enter is pressed. When set to `false` the command will restart.\n* `timing.hiddenCommands`: An array of commands that shall be hidden from the command palette.\n* `timing.hoverDuration.enabled`: Controls whether the duration hover is enabled or disabled.\n* `timing.hoverDuration.sourceUnit`: Indicates the source epoch unit for the duration hover preview. It can be either \"s\", \"ms\", \"μs\" or \"ns\".\n* `timing.hoverDuration.useISOTargetFormat`: Indicates whether the ISO 8601 duration definition is used as target format for the hover.\n* `timing.hoverTimestamp.enabled`: Controls whether the timestamp hover is enabled or disabled.\n* `timing.hoverTimestamp.targetFormat`: Indicates the target format of the hover preview. Possible values are an array of:\n  * `utc`: Show the hover preview in ISO 8601 UTC time. This is the default value.\n  * `local`: Show the hover preview in ISO 8601 Local time.\n  * A custom [momentjs format](https://momentjs.com/docs/#/displaying/format/): For instance `LLLL`.  \n\n  In addition, you can specify a custom format via an object. When doing so, you can add further options like the target `timezone`. E.g.:\n  ```json\n  {\n      \"timing.hoverTimestamp.targetFormat\": [\n          \"local\",\n          \"utc\",\n          \"DD.MM.YYYY HH:mm:ss\",\n          {\n              \"customFormat\": \"DD.MM.YYYY HH:mm:ss\",\n              \"timezone\": \"Europe/Berlin\",\n              \"name\": \"My Format\"\n          }\n      ]\n  }\n  ```\n\n* `timing.ignoreFocusOut`: Indicates whether the input boxes remain visible when the focus is lost.\n* `timing.insertConvertedTime`: Indicates whether a converted time is [inserted](#insert-converted-time) at the cursor's current position after conversion. When enabled, no result view is shown.\n\n## Command Overview\n\nTo view all commands, open the _command palette_ and type _Timing_.  \nOptional arguments can be used to reduce the amount of required user inputs during a conversion. They can only be used when the command is invoked via a [hotkey](#keyboard-shortcuts).  \n\nCommand Id | Description | Optional Arguments (`string`)\n:--|:-- |:--\n`timing.customToCustom`| Custom ⟶ Custom | `sourceFormat`, `targetFormat`\n`timing.customToEpoch`| Custom ⟶ Epoch | `sourceFormat`, `targetUnit`\n`timing.customToIsoLocal`| Custom ⟶ ISO 8601 Local | `sourceFormat`\n`timing.customToIsoUtc`| Custom ⟶ ISO 8601 UTC | `sourceFormat`\n`timing.epochToCustom`| Epoch ⟶ Custom | `targetFormat`\n`timing.epochToCustomTimezone`| Epoch ⟶ Custom Timezone | `targetFormat`, `timezone`\n`timing.epochToIsoDuration`| Epoch ⟶ ISO 8601 Duration | `sourceUnit`\n`timing.epochToIsoLocal`| Epoch ⟶ ISO 8601 Local\n`timing.epochToIsoTimezone`| Epoch ⟶ ISO 8601 Custom Timezone | `timezone`\n`timing.epochToIsoUtc`| Epoch ⟶ ISO 8601 UTC\n`timing.epochToReadableDuration`| Epoch ⟶ Readable Duration | `sourceUnit`\n`timing.epochToGps`| Epoch ⟶ GPS\n`timing.isoDurationToEpoch`| ISO 8601 Duration ⟶ Epoch | `targetUnit`\n`timing.isoRfcToCustom`| ISO 8601 / RFC 2822 ⟶ Custom | `targetFormat`\n`timing.isoRfcToEpoch`| ISO 8601 / RFC 2822 ⟶ Epoch | `targetUnit`\n`timing.nowAsCustom`| Now ⟶ Custom | `targetFormat`\n`timing.nowAsEpoch`| Now ⟶ Epoch | `targetUnit`\n`timing.nowAsIsoLocal`| Now ⟶ ISO 8601 Local\n`timing.nowAsIsoUtc`| Now ⟶ ISO 8601 UTC\n`timing.toggleInsertConvertedTimeUserLevel`| toggle the `timing.insertConvertedTime` user setting\n\n## Keyboard Shortcuts\n\nAny of the above commands can be bound to its own keyboard shortcut. For that just open the _Keyboard Shortcuts_ view by pressing \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eK\u003c/kbd\u003e \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eS\u003c/kbd\u003e. Now search for the corresponding command and assign it to a shortcut.  \nAlternatively, you can edit the `keybindings.json` directly. For example you can add the following entry to the `keybindings.json` to bind the `timing.customToEpoch` to the keyboard shortcut \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eK\u003c/kbd\u003e \u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eZ\u003c/kbd\u003e.  \n\n```json\n{\n    \"key\": \"ctrl+k ctrl+z\",\n    \"command\": \"timing.customToEpoch\"\n}\n```\n\nFurther if you know that you will always use the same parameter for the command you can add _optional arguments_.  \nExample:\n\n```json\n{\n    \"key\": \"ctrl+k ctrl+z\",\n    \"command\": \"timing.customToEpoch\",\n    \"args\": {\n        \"sourceFormat\": \"DD/MM/YYYY\",\n        \"targetUnit\": \"ms\"\n    }\n}\n```\n\nFor further information check out the [docs](https://code.visualstudio.com/docs/getstarted/keybindings).\n\n## Contribution\n\nIf you found a bug or are missing a feature do not hesitate to [file an issue](https://github.com/HaaLeo/vscode-timing/issues/new/choose).  \nPull Requests are welcome!\n\n## Support\nWhen you like this extension make sure to [star the repo](https://github.com/HaaLeo/vscode-timing/stargazers) and [write a review](https://marketplace.visualstudio.com/items?itemName=HaaLeo.timing\u0026ssr=false#review-details). I am always looking for new ideas and feedback.  \nIn addition, it is possible to [donate via paypal](https://www.paypal.me/LeoHanisch/3eur).\n\n## Examples\n\n### Conversion via Command Palette\n\n#### Simple Conversion\n\nIn order to convert a time via the command palette there exist several commands. Each command will show up an input box where you can enter the time. After pressing \u003ckbd\u003eEnter\u003c/kbd\u003e it will display the converted time in the input box again, ready to be copied.\n\n![Convert Sample](doc/Convert_Sample.gif)\n\n#### Pre-selection\n\nIf a valid time string is pre-selected, the command will directly convert the selection and show the corresponding result.\n\n![Convert Selection Sample](doc/Convert_Selection_Sample.gif)\n\n#### Options\n\nIf required, the command will ask you to select the **target format** of the time.\n\n![Convert Selection Option Sample](doc/Convert_Selection_Option_Sample.gif)\n\n### Current Time\n\nIn addition, you can also get the current time as **epoch**, **ISO 8601**, or **custom** format.\n\n![Now as ISO 8601 Local](doc/Get_Now_Local_Sample.gif)\n\n### Custom Formats\n\nTo convert different times from/to custom formats you need to insert a **valid [momentjs format](https://momentjs.com/docs/#/displaying/format/)** after you invoke a corresponding command.  \n\n![Convert To CustomSample](doc/Convert_To_Custom_Sample.gif)\n\nOptionally you can specify **custom formats** of the following shape in the user settings. Those will be shown as possible options.  \nExample:\n\n```json\n{\n    \"timing.customFormats\": [\n        {\n            \"format\": \"LLLL\",\n            \"description\": \"US\",\n            \"detail\": \"Often used in the US\"\n        },\n        {\n            \"format\": \"DD.MM.YYYY HH:mm:ss\",\n            \"description\": \"GER\",\n            \"detail\": \"Often used in Germany\"\n        }\n    ]\n}\n```\n\n### Hover Preview\n\nWhen you hover over a number the extension shows you the converted **UTC**, **Local**, or **Custom** timestamp and which **unit** was used for the conversion. The target time is indicated by the `timing.hoverTimestamp.targetFormat` setting. Its default value is `utc`.  Further it also shows the converted duration.  \n\nBoth hover provider can be configured via several [settings](#settings-overview)\n\n![Hover Sample](doc/Hover_Sample.gif)\n\n### Insert Converted Time\n\nYou can add the setting `\"timing.insertConvertedTime\": true` in order to automatically replace the cursor's selection with the converted time. When `timing.insertConvertedTime` is set to `true`, no result view will be shown. To enable that behavior there exists the command `timing.toggleInsertConvertedTimeUserLevel` to toggle this setting (on User Level).  \nAlternatively, you can press the pencil button in the top right corner of the result view.\n\n* `\"timing.insertConvertedTime\": true`  \n  ![Insert Sample 1](doc/Insert_Sample1.gif)\n* `\"timing.insertConvertedTime\": false`  \n  ![Insert Sample 2](doc/Insert_Sample2.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaaleo%2Fvscode-timing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaaleo%2Fvscode-timing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaaleo%2Fvscode-timing/lists"}