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()
Variable
from TimeConvert import TIME_ZONE, TIME_FORMAT
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 ? # TIME_COUNT_DOWN def timestamp_countdown(stamp): def datetime_countdown(dt): def string_countdown(string, format=TIME_FORMAT): # 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.6.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file TimeConvert-1.1.6.tar.gz
.
File metadata
- Download URL: TimeConvert-1.1.6.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d7ed4f0a128afa9d1d15bdd58010594e02d9935bbcebeabd0355ce84929e2d7 |
|
MD5 | 63a74e0a1503158b27ca40d1db023586 |
|
BLAKE2b-256 | fd2d6816f919b7aa6f89e7ffaf0e87cdd39ffed184c56d2693747367e481d91c |
File details
Details for the file TimeConvert-1.1.6-py2.py3-none-any.whl
.
File metadata
- Download URL: TimeConvert-1.1.6-py2.py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d5c5de3bd0450082b4a34f473fb182be8a631923569f15e9854728e9a34a5e |
|
MD5 | 423311bc7261fa4a04e611c1349b77b5 |
|
BLAKE2b-256 | bce36f89fb18176831135ced8fa7c4e713bf12a7ec2d8376c87311b9e26a025f |