Skip to content

🔧 VS Code tool that allows developers to easily read unix timestamps inline by displaying human-readable UTC time

License

Notifications You must be signed in to change notification settings

3sannasia/VSCode-Extension-Unix-to-UTC

Repository files navigation

logo

Unix to UTC

Allows developers to easily read unix timestamps in VS Code

Version 2.0.4

VS Code Marketplace • Features • Requirements • FAQ


license

Features

  • Note: Requires some globally installed python libraries

  • Convert Unix timestamps to UTC ISO 8601 timestamps

    unix->utc gif

  • Convert ISO 8601 timestamps to Unix timestamps

    utc->unix gif

  • Replace UTC/Unix timestamps

    replacetime

  • Get current Unix timestamp

    cur unix gif

  • Get current UTC timestamp

    cur utc gif

  • Uses updated timezone accurate Python Datetime functions

Requirements

  • Must be globally installed (no venv)

Quick Install

pip3 install uvicorn && pip3 install starlette && pip3 install httpx && pip3 install fastapi

uvicorn: ^0.24.0

pip3 install uvicorn

starlette: ^0.27.0

pip3 install starlette

httpx: ^0.26.0

pip3 install httpx

fastapi: ^0.104.1

pip3 install fastapi

FAQ

Nothing happens when running extension commands?

If no notification window pops up on the bottom right of VS Code make sure you installed required python libraries in Requirements. These must be installed globally and not through a virtual environment.

Since this extension uses the Python Datetime library to provide accurate timestamps with the TypeScript VS Code API, it needs libraries like FastAPI installed on your local computer.

What is a Unix timestamp?

Unix time is a date and time representation widely used in computing. It measures time by the number of non-leap seconds that have elapsed since 00:00:00 UTC on 1 January 1970, the Unix epoch.

Ex: 1707228725.163333

What is an ISO 8601 format timestamp and why use it?

ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. I chose this format for its precision and ability to represent UTC offset. It has strong use cases in worldwide communication and time-synchronization.

Ex: 2024-02-06T14:12:05.163333+00:00

The ISO 8601 includes the year (YYYY), month (MM), day (DD), followed by the letter 'T' to separate the date from the time, and then the hours (HH), minutes (MM), seconds (SS), and fractional seconds (SSSSSS) with a decimal point. The '+00:00' at the end represents the UTC offset, indicating that the time is in Coordinated Universal Time (UTC) with zero offset (no time zone adjustment).

Future Plan

  • Use the VSCode Hover API to see time conversions on hover
    • Eliminates multiple command clicks
  • Add features for the terminal
    • Currently commands only available in the editor
    • Waiting on the development of an upgraded VSCode Terminal API to allow getting the user's terminal selection
  • Enable virtual environment support for python libaries

Usage

Local Development