Skip to main content

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 ?

# 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


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.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

TimeConvert-1.1.3-py2.7.egg (11.3 kB view details)

Uploaded Source

File details

Details for the file TimeConvert-1.1.3.tar.gz.

File metadata

  • Download URL: TimeConvert-1.1.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for TimeConvert-1.1.3.tar.gz
Algorithm Hash digest
SHA256 9ee693492df695166a93480350f4615630cd832520370fb39b0a13eb2fafe964
MD5 dc39a9e91b6127c4e7d9dbf0e67c34b4
BLAKE2b-256 8e5b80393bfb2190b8193d1191570d8da724220363531bedf01fd3aec9171294

See more details on using hashes here.

File details

Details for the file TimeConvert-1.1.3-py2.7.egg.

File metadata

File hashes

Hashes for TimeConvert-1.1.3-py2.7.egg
Algorithm Hash digest
SHA256 10c0d99149fd212cbf1101be1ec5729342fffe32ae1a8cc4514c9c7ab4681ce6
MD5 77a7e49150407f51aa603ad1979ca3b2
BLAKE2b-256 a56cda11e613f248dc94551e67e589e8b7955ecfd60d72ea9c9b9b31609b2e31

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