Advanced date and time management library.
Project description
Timedate
Advanced date and time management library.
Python library by LassaInora.
Summary
Links
Contacts
Supported languages:
- English (en)
- Mandarin Chinese (ma)
- Hindi (hi)
- Spanish (sp)
- Bengali (be)
- French (fr)
- Russian (ru)
- Portuguese (po)
Timedate functions and variables:
- DELTA
- All time zones and their offset with UTC in seconds
- set_language()
- Change the default language of the library.
[en, ma, hi, sp, be, fr, ru, po] are accepted.
- Change the default language of the library.
Class Time:
-
Time initialization.
- year: The number of year. Default is 0.
- month: The number of month. Default is 0.
- day: The number of day. Default is 0.
- hour: The number of hour. Default is 0.
- minute: The number of minute. Default is 0.
- second: The number of second. Default is 0.
- millisecond: The number of millisecond. Default is 0.
- microsecond: The number of microsecond. Default is 0.
- nanosecond: The number of nanosecond. Default is 0.
- name: The name of the time. Default is None.
- language: The language for use. Default is LANGUAGE.
-
Methods:
- by_date:
- Static method allowing to convert a Date into Time.
- by_datetime_date:
- Static method allowing to convert a datetime.date into Time.
- by_datetime_time:
- Static method allowing to convert a datetime.time into Time.
- by_datetime_datetime:
- Static method allowing to convert a datetime.datetime into Time.
- update:
- Allows to update the attributes.
- abs(time):
- Return the absolute value from the current object time.
- -time:
- Returns the opposite from the current object time.
- time + x:
- Add x nanosecond from the current object time.
- time + another_time:
- Add another_time from the current object time.
- time - x:
- Remove x nanosecond from the current object time.
- time - another_time:
- Remove another_time from the current object time.
- time == x:
- Checks equality with x.
- time != x:
- Checks inequality with x.
- str(time):
- Sends a character string corresponding to the object.
- print(time):
- Print a character string corresponding to the object.
- format(time, "..."):
- Sends a character string formatted according to the character string.
For an example of Time(year=1985, month=6, day=21, hour=11, minute=1, second=59, millisecond=13, microsecond=541, name='Example') format: - _name_ -> Example - _Y_ -> 1985 - _M_ -> 6 - _D_ -> 21 - _h_ -> 11 - _m_ -> 1 - _s_ -> 59 - _mls_ -> 13 - _mcs_ -> 541 - _nns_ -> 800
- time[x]:
- Sends the value of the object according to x.
- list(time):
- Returns a list with the values of the object.
- iter(time):
- Returns a list with the values of the object.
- get:
- Returns the value of the current object in the given unit.
- get_value:
- Returns the value of the given unit of the current object.
- rename:
- Rename the current object.
- set_language:
- Changes the current language of the object.
- by_date:
Class Date:
-
Date initialization.
- year: The number of year. Default is None.
- month: The number of month. Default is None.
- day: The number of day. Default is None.
/!\ If year, month and day are all None, year will be 400, month and day will be 1 otherwise the None values will be set to 0
- hour: The number of hour. Default is 0.
- minute: The number of minute. Default is 0.
- second: The number of second. Default is 0.
- millisecond: The number of millisecond. Default is 0.
- microsecond: The number of microsecond. Default is 0.
- nanosecond: The number of nanosecond. Default is 0.
- name: The name of the date. Default is None.
- language: The language for use. Default is LANGUAGE.
-
Methods:
- by_time:
- Static method allowing to convert a Time into Date.
- by_datetime_date:
- Static method allowing to convert a datetime.date into Date.
- by_datetime_time:
- Static method allowing to convert a datetime.time into Date.
- by_datetime_datetime:
- Static method allowing to convert a datetime.datetime into Date.
- now:
- Static method get the current date.
- update:
- Allows to update the attributes.
- countdown:
- Returns a Time value of the time remaining until this date.
- chrono:
- Returns a Time value of the time elapsed since this date.
- get_name_month:
- Give the name of the month.
- get_name_day:
- Give the name of the day of the week.
- abs(time):
- Return the absolute value from the current object time.
- -time:
- Returns the opposite from the current object time.
- time + x:
- Add x nanosecond from the current object time.
- time + another_time:
- Add another_time from the current object time.
- time - x:
- Remove x nanosecond from the current object time.
- time - another_time:
- Remove another_time from the current object time.
- time == x:
- Checks equality with x.
- time != x:
- Checks inequality with x.
- str(time):
- Sends a character string corresponding to the object.
- print(time):
- Print a character string corresponding to the object.
- format(time, "..."):
- Sends a character string formatted according to the character string.
For an example of Date(year=1985, month=6, day=21, hour=11, minute=1, second=59, millisecond=13, microsecond=541, name='Example') format: - _name_ -> Example - _YYYY_ -> 1985 [force has 4 characters] - _YY_ -> 85 [force has 2 characters] - _Y_ -> 1985 - _MM_ -> 06 [force has 2 characters] - _NM_ -> June - _M_ -> 6 - _DD_ -> 21 [force has 2 characters] - _ND_ -> Friday - _D_ -> 21 - _hh_ -> 11 [force has 2 characters] - _h_ -> 11 - _mm_ -> 01 [force has 2 characters] - _m_ -> 1 - _ss_ -> 59 [force has 2 characters] - _s_ -> 59 - _mls_ -> 013 [force has 3 characters] - _mcs_ -> 541 [force has 3 characters] - _nns_ -> 800 [force has 3 characters]
- time[x]:
- Sends the value of the object according to x.
- list(time):
- Returns a list with the values of the object.
- iter(time):
- Returns a list with the values of the object.
- get:
- Returns the value of the current object in the given unit.
- get_value:
- Returns the value of the given unit of the current object.
- rename:
- Rename the current object.
- set_language:
- Changes the current language of the object.
- by_time:
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
advanced_timedate-1.0.2.tar.gz
(24.9 kB
view hashes)
Built Distribution
Close
Hashes for advanced_timedate-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4ee247419e0e3600ba309afee1759fbc9a6d9a28b3c48dfc5e3f5dd08994384 |
|
MD5 | 063056e9d8f197af73b970b37a2dcaa7 |
|
BLAKE2b-256 | acadddcbb81870a3cb8fa3c250cd5de35ccf8cfc0cc7a8674c96ee3861cc9261 |