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.4.tar.gz (2.9 kB view hashes)

Uploaded source

Built Distribution

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

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page