Skip to main content

Convert date to milliseconds and back

Project description

toms - unix timestamp converter

PyPI

Features:

  • Convert unix epoch millis to UTC iso date
  • Convert UTC iso date to unix epoch millis
  • Read from stdin
  • Replace all occurrences of unix epoch millis with iso date in text
  • Print current time millis

install

pip3 install toms

examples

Convert unix epoch millis to UTC iso date

toms 1500000000000
2017-07-14T02:40:00+00:00

Convert UTC iso date to unix epoch millis

toms 2017-07-14T02:40
1500000000000

Read from stdin

echo '2019-01-01 2020-01-01T10:12' | toms
1546300800000
1577873520000

Replace all occurrences of unix epoch millis with iso date in text

echo 'text 1500000000000 text' > /tmp/some-text.txt
cat /tmp/some-text.txt | toms replace
text 2017-07-14T02:40:00+00:00 text

Print current time millis

toms now
1592335604695

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toms-0.4.5.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

toms-0.4.5-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page