Skip to main content

Advanced date and time management library.

Project description

Timedate

Advanced date and time management library.

Python library by LassaInora.


Summary


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.

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.

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.

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

advanced_timedate-2.0.0.tar.gz (24.4 kB view hashes)

Uploaded Source

Built Distribution

advanced_timedate-2.0.0-py3-none-any.whl (24.4 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