Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tallesl/py-unix-time
Unix timestamp made easy.
https://github.com/tallesl/py-unix-time
epoch epoch-time posix-time time timestamp unix-timestamp
Last synced: about 2 months ago
JSON representation
Unix timestamp made easy.
- Host: GitHub
- URL: https://github.com/tallesl/py-unix-time
- Owner: tallesl
- Created: 2019-09-09T20:03:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-30T21:19:17.000Z (over 5 years ago)
- Last Synced: 2024-10-14T12:48:37.832Z (3 months ago)
- Topics: epoch, epoch-time, posix-time, time, timestamp, unix-timestamp
- Language: Python
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unix-time
[![](https://badge.fury.io/py/unix-time.svg)](https://pypi.org/project/unix-time)
Unix timestamp made easy.
```py
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:00from 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
```