gigl.src.common.utils.time#
Functions#
| 
 | |
| 
 | |
| 
 | |
| 
 | Validates a datetime string with specified format. ex "%Y%m%d" for "YYYYmmdd" | 
| 
 | 
Module Contents#
- gigl.src.common.utils.time.convert_days_to_ms(days)[source]#
- Parameters:
- days (int) 
- Return type:
- int 
 
- gigl.src.common.utils.time.current_datetime()[source]#
- Returns:
- current timezone aware utc datetime. 
- Return type:
- str 
 
- gigl.src.common.utils.time.current_formatted_datetime(fmt=DEFAULT_DATETIME_FORMAT)[source]#
- Returns:
- current timezone aware utc datetime formatted as a string as per provided date format string. 
- Return type:
- str 
- Parameters:
- fmt (str) 
 
- gigl.src.common.utils.time.format_datetime(dt, fmt=DEFAULT_DATETIME_FORMAT)[source]#
- Parameters:
- dt (datetime.datetime) 
- fmt (str) 
 
- Return type:
- str 
 
- gigl.src.common.utils.time.is_datetime_str_format_valid(datetime_str, datetime_format)[source]#
- Validates a datetime string with specified format. ex “%Y%m%d” for “YYYYmmdd” Return True/False so users can decide to raise error or reformat string - Parameters:
- datetime_str (str) 
- datetime_format (str) 
 
- Returns:
- Return type:
- bool 
 
