Time Convert for Humans
Project description
TimeConvert is a simple time convert script(library) for Python, built for human beings.
Installation
pip install TimeConvert
Usage
from TimeConvert import TimeConvert as tc tc.utc_timestamp()
Method
# VALIDATE def validate_string(string, format=TIME_FORMAT): # DATETIME def utc_datetime(): def local_datetime(): def to_utc_datetime(local_dt, timezone=TIME_ZONE): def to_local_datetime(utc_dt, timezone=TIME_ZONE): def yesterday_utc_datetime(): def tomorrow_utc_datetime(): def yesterday_local_datetime(): def tomorrow_local_datetime(): def several_days_ago(dt=None, days): def several_days_coming(dt=None, days): def several_time_ago(dt=None, days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0): def several_time_coming(dt=None, days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0): # STRING def utc_string(utc_dt=None, format=TIME_FORMAT): def local_string(local_dt=None, format=TIME_FORMAT): def datetime_to_string(dt, format=TIME_FORMAT): # TIMESTAMP def utc_timestamp(utc_dt=None): def local_timestamp(local_dt=None): def datetime_to_timestamp(dt): # STRING ==> DATETIME def string_to_utc_datetime(string, format=TIME_FORMAT): def string_to_local_datetime(string, format=TIME_FORMAT): # STRING ==> TIMESTAMP def string_to_timestamp(string, format=TIME_FORMAT): def string_to_utc_timestamp(string, format=TIME_FORMAT): def string_to_local_timestamp(string, format=TIME_FORMAT): # TIME_DELTA def timestamp_delta(stamp1, stamp2, interval=None): def datetime_delta(dt1, dt2, interval=None): def string_delta(string1, string2, interval=None, format=TIME_FORMAT, format1='', format2=''): PS: interval(seconds) —— Time1 - Time2 >= interval ? # AWARE vs NAIVE def is_aware(value): def is_naive(value): def make_aware(value, timezone=TIME_ZONE): def make_naive(value, timezone=TIME_ZONE): # OTHER def total_seconds(td): # timedelta
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
TimeConvert-1.1.0.tar.gz
(5.1 kB
view details)
Built Distribution
TimeConvert-1.1.0-py2.7.egg
(10.8 kB
view details)
File details
Details for the file TimeConvert-1.1.0.tar.gz
.
File metadata
- Download URL: TimeConvert-1.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5231af3b248ec6abf98cb5f2b2ab990c65b96ac724c9a2f64ba92a6576ed35c |
|
MD5 | ea6e4ccda115dc1c316fcc187a4af2b0 |
|
BLAKE2b-256 | 09fc28b94847b492c65738fc9f4e74e33ce5ad23393ddf6449bfa9d1f461a7f6 |
File details
Details for the file TimeConvert-1.1.0-py2.7.egg
.
File metadata
- Download URL: TimeConvert-1.1.0-py2.7.egg
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df9153e2cd7f46ce38e31160a8892c55f0278f872a51c59b9fff34399036a32 |
|
MD5 | 01debd422a34bdc5d758a6bcabdfbee1 |
|
BLAKE2b-256 | a215bc6dd892079b4e40b713b1aa9f5a14e1ad1c2968c1921af6b46b0dd0f49a |