Skip to main content

Gajula Package consists of useful utilites and functions

Project description

This is a package comes with general utilities and functions

timeutils functions:

****today**: returns today date object or string**

**time** : returns time in given timezone in object or string

**now**: returns local TS in desired format object, string, UNIX

**utcnow**: same as now but in UTC

**tznow**: same as above but given timezone

**str_to_date**: takes string and returns date object

**str_to_time**: takes string and returns time object

**to_datetime**: takes string or UNIX and returns TS object

**to_unix**: takes string or TS object and returns UNIX TS

**change_tz**: takes string or UNIX or TS object and changes to desired timezone
            String -> string
            TS object -> TS object
            UNIX -> UNIX

**second_now**: returns current second in the day

**today_midnight**: returns today midnight TS object

**time_btw**: takes 2 timestamps returns time gap (secs, minutes, hours, days, weeks)

**ts_from_now**:(-past and +future ) takes timestamp and gives next timestamp 
            in given weeks, days, hours, minutes, secs

**weekdays_btw**: takes 2 dates and returns weekday (monday,sunday,3,4) Monday = 0

**weekends_btw**: takes 2 dates and returns weekends in between

**workdays_btw**: takes 2 dates and returns working days between 
**ALL THREE above support string or date object.**

**random_ts**: returns random timestamp in future or past

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

gajula-0.0.20.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

gajula-0.0.20-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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