Fixes in documentation

This commit is contained in:
absurdo 2023-11-04 21:15:44 +01:00
parent cfb70403c1
commit dc58175760
13 changed files with 119 additions and 113 deletions

View file

@ -81,7 +81,7 @@ def format_timedata(time):
time (str): A YYYYMMDDHHmmss string for get datetime components from there.
Returns:
list: A dict with datetime components (year, month, day, hour, minute, second).
list (list): A dict with datetime components (year, month, day, hour, minute, second).
"""
@ -131,7 +131,7 @@ def checkdatetime(y, m, d, h, mi, s):
s (int): seconds
Returns:
bool: If values are correct, return True, otherwise return False
bool (bool): If values are correct, return True, otherwise return False
"""
@ -153,7 +153,7 @@ def now(utc=False, tz=''):
tz (str, optional): Timezone name, example: Europe/Madrid. If set the datetime is returned in the timezone selected
Returns:
str: Return actual datetime
datetime (str): Return actual datetime
"""
@ -180,7 +180,7 @@ def today(utc=False,tz=''):
tz (str, optional): Timezone name, example: Europe/Madrid. If set the date is returned in the timezone selected
Returns:
str: Return actual date with 00:00:00 how time
datetime (str): Return actual date with 00:00:00 how time
"""
@ -197,7 +197,7 @@ def obtain_timestamp(timeform):
Returns:
int: datetime in timestamp format
Timestamp (int): datetime in timestamp format
"""
@ -225,7 +225,7 @@ def timestamp_to_datetime(timestamp, sql_format_time=sql_format_time):
timestamp (int): The timestamp for convert
Returns:
str: Datetime in YYYYMMDDHHmmss format
datetime (str): Datetime in YYYYMMDDHHmmss format
"""
@ -242,7 +242,7 @@ def timestamp_to_datetime_local(timestamp, tz='', sql_format_time=sql_format_tim
Returns:
str: Datetime in YYYYMMDDHHmmss format in selected timezone datetime
datetime (str): Datetime in YYYYMMDDHHmmss format in selected timezone datetime
"""
@ -264,7 +264,7 @@ def format_datetime(format_time, timeform, func_utc_return):
func_utc_return (function): A function used for get the datetime.
Returns:
If timestamp is False, return False, if timestamp is valid, return the datetime formatted
datetime (str): If timestamp is False, return False, if timestamp is valid, return the datetime formatted
"""
@ -293,7 +293,7 @@ def local_to_gmt(timeform, sql_format_time=sql_format_time):
sql_format_time (str, optional): by default, the format is YYYYMMDDHHmmss, you can put other formatted str formats for date, here.
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
@ -312,7 +312,7 @@ def gmt_to_local(timeform, sql_format_time=sql_format_time):
sql_format_time (str, optional): by default, the format is YYYYMMDDHHmmss, you can put other formatted str formats for date, here.
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
@ -326,7 +326,7 @@ def format_time(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
"""
@ -340,7 +340,7 @@ def format_date(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
"""
return format_datetime(format_date_txt, timeform, sum_utc)
@ -353,7 +353,7 @@ def format_fulldate(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
"""
return format_datetime(format_date_txt+' '+format_time_txt, timeform, sum_utc)
@ -366,7 +366,7 @@ def format_local_time(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
return format_datetime(format_time_txt, timeform, no_utc)
@ -379,7 +379,7 @@ def format_local_date(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
return format_datetime(format_date_txt, timeform, no_utc)
@ -392,7 +392,7 @@ def format_local_fulldate(timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
return format_datetime(format_date_txt+' '+format_time_txt, timeform, no_utc)
@ -405,7 +405,7 @@ def format_strtime(strtime, timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted in UTC
"""
return format_datetime(strtime, timeform, sum_utc)
@ -418,7 +418,7 @@ def format_local_strtime(strtime, timeform):
timeform (str): datetime in YYYYMMDDHHmmss format to convert to new format
Returns:
If timeform is False, return False, if timeform is valid, return the datetime formatted
datetime (str): If timeform is False, return False, if timeform is valid, return the datetime formatted
"""
return format_datetime(strtime, timeform, no_utc)
@ -434,7 +434,7 @@ def sum_utc(timestamp, tz=''):
tz (str): Timezone of timestamp
Returns:
Return arrow object with new timezone selected
datetime (str): Return arrow object with new timezone selected
"""
#offset=time.altzone
@ -459,7 +459,7 @@ def substract_utc(timestamp, tz=''):
tz (str): Timezone of timestamp
Returns:
Return arrow object with UTC timezone selected
datetime (str): Return arrow object with UTC timezone selected
"""
#offset=time.altzone
@ -487,7 +487,7 @@ def no_utc(timestamp):
timestamp (int): The timestamp for convert in UTC timezone
Returns:
Return arrow object based in timestamp value
datetime (str): Return arrow object based in timestamp value
"""
@ -550,7 +550,7 @@ class TimeClass:
num_months (int): Number of months to add
Returns:
New added datetime
datetime (str): New added datetime
"""
m=self.t.shift(months=+num_months)
@ -564,7 +564,7 @@ class TimeClass:
num_months (int): Number of months to substract
Returns:
New substracted datetime
datetime (str): New substracted datetime
"""
m=self.t.shift(months=-num_months)
@ -578,7 +578,7 @@ class TimeClass:
num_days (int): Number of days to add
Returns:
New added datetime
datetime (str): New added datetime
"""
m=self.t.shift(days=+num_days)
@ -592,7 +592,7 @@ class TimeClass:
num_days (int): Number of days to substract
Returns:
New substracted datetime
datetime (str): New substracted datetime
"""
@ -607,7 +607,7 @@ class TimeClass:
num_years (int): Number of years to add
Returns:
New added datetime
datetime (str): New added datetime
"""
m=self.t.shift(years=+num_years)
@ -621,7 +621,7 @@ class TimeClass:
num_years (int): Number of years to substract
Returns:
New substracted datetime
datetime (str): New substracted datetime
"""
m=self.t.shift(years=-num_years)
@ -635,7 +635,7 @@ class TimeClass:
num_hours (int): Number of hours to add
Returns:
New added datetime
datetime (str): New added datetime
"""
m=self.t.shift(hours=+num_hours)
@ -649,7 +649,7 @@ class TimeClass:
num_hours (int): Number of hours to substract
Returns:
New substracted datetime
datetime (str): New substracted datetime
"""
m=self.t.shift(hours=-num_hours)
@ -660,7 +660,7 @@ class TimeClass:
"""Method for get datetime formatted using format_date_full attribute
Returns:
Datetime formatted with format_date_full attribute
datetime (str): Datetime formatted with format_date_full attribute
"""
return self.t.format(self.format_date_full)
@ -669,7 +669,7 @@ class TimeClass:
"""Method for get datetime formatted using format_time attribute
Returns:
Datetime formatted with format_time attribute
datetime (str): Datetime formatted with format_time attribute
"""
return self.t.format(self.format_time)
@ -699,7 +699,7 @@ class TimeClass:
Returns:
Actual datetime formatted in YYYYMMDDHHmmss format.
datetime (str): Actual datetime formatted in YYYYMMDDHHmmss format.
"""
if not utc:
@ -719,7 +719,7 @@ class TimeClass:
Returns:
Actual datetime formatted in YYYYMMDD000000 format.
datetime (str): Actual datetime formatted in YYYYMMDD000000 format.
"""
if utc:
@ -738,7 +738,7 @@ class TimeClass:
Returns:
Datetime in YYYYMMDDHHmmss format.
datetime (str): Datetime in YYYYMMDDHHmmss format.
"""
return arrow.get(timestamp).format(sql_format_time)
@ -752,7 +752,7 @@ class TimeClass:
Returns:
Datetime in YYYYMMDDHHmmss format.If timeform is incorrect, return False
datetime (str): Datetime in YYYYMMDDHHmmss format.If timeform is incorrect, return False
"""
y, m, d, h, mi, s=format_timedata(timeform)
@ -776,7 +776,7 @@ class TimeClass:
Returns:
Datetime in strtime format.If timeform is incorrect, return False
datetime (str): Datetime in strtime format.If timeform is incorrect, return False
"""