cengal.time_management.relative_time.bysiness_relativedelta.versions.v_0.bysiness_relativedelta

 1#!/usr/bin/env python
 2# coding=utf-8
 3
 4# Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
 5# 
 6# Licensed under the Apache License, Version 2.0 (the "License");
 7# you may not use this file except in compliance with the License.
 8# You may obtain a copy of the License at
 9# 
10#     http://www.apache.org/licenses/LICENSE-2.0
11# 
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18import bdateutil.relativedelta
19from math import ceil
20from typing import Union
21from ....constants import SECONDS_PER_DAY
22
23"""
24Module Docstring
25Docstrings: http://www.python.org/dev/peps/pep-0257/
26"""
27
28__author__ = "ButenkoMS <gtalk@butenkoms.space>"
29__copyright__ = "Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>"
30__credits__ = ["ButenkoMS <gtalk@butenkoms.space>", ]
31__license__ = "Apache License, Version 2.0"
32__version__ = "4.4.1"
33__maintainer__ = "ButenkoMS <gtalk@butenkoms.space>"
34__email__ = "gtalk@butenkoms.space"
35# __status__ = "Prototype"
36__status__ = "Development"
37# __status__ = "Production"
38
39
40def seconds_to_relativedelta(seconds: Union[int, float]=0) -> bdateutil.relativedelta:
41    return bdateutil.relativedelta(bdays=ceil(seconds / SECONDS_PER_DAY))
def seconds_to_relativedelta(seconds: Union[int, float] = 0) -> bdateutil.relativedelta.relativedelta:
41def seconds_to_relativedelta(seconds: Union[int, float]=0) -> bdateutil.relativedelta:
42    return bdateutil.relativedelta(bdays=ceil(seconds / SECONDS_PER_DAY))