Skip to main content

Unix timestamp made easy.

Project description

unix-time

Unix timestamp made easy.

from unix_time import *

now = ts_now()  # 1568078625, 2019-09-10T01:23:45

yesterday = ts_yesterday()  # 1567987200, 2019-09-09T00:00:00
today = ts_today()  # 1568073600, 2019-09-10T00:00:00
tomorrow = ts_tomorrow()  # 1568160000, 2019-09-11T00:00:00

from datetime import datetime

dt = datetime.fromisoformat('2019-09-10T01:23:45+00:00')

date_plus_time = ts(dt)  # 1568078625, 2019-09-10T01:23:45
date_no_time = ts_date(dt)  # 1568073600, 2019-09-10T00:00:00

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

unix-time-2.0.0.tar.gz (1.4 kB view details)

Uploaded Source

File details

Details for the file unix-time-2.0.0.tar.gz.

File metadata

  • Download URL: unix-time-2.0.0.tar.gz
  • Upload date:
  • Size: 1.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for unix-time-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c6e8b3b05bb80d446b022a3f5f024dedf26f8873370d601263f00c89b4baaff1
MD5 5af8215c2efd1f418a2c7cfabe396055
BLAKE2b-256 8a51b2bb448258eb720b54c40bab39e002b0ef1dd91918ed7b37097a0054ddc8

See more details on using hashes here.

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