Skip to content

Commit

Permalink
renamed datetime utility to avoid hinting confusion with base package…
Browse files Browse the repository at this point in the history
…, added type hinting (GEOS-ESM#349)
  • Loading branch information
mranst committed Sep 11, 2024
1 parent f9b50f2 commit ccb93d6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import re
import datetime as pydatetime


# --------------------------------------------------------------------------------------------------

datetime_formats = {
Expand All @@ -26,7 +25,7 @@

class Datetime:

def __init__(self, datetime_input):
def __init__(self, datetime_input) -> None:

# Convert input string to standard format yyyymmddHHMMSS
datetime_str = re.sub('[^0-9]', '', datetime_input+'000000')[0:14]
Expand All @@ -42,13 +41,13 @@ def dto(self):

# ----------------------------------------------------------------------------------------------

def string_iso(self):
def string_iso(self) -> str:

return self.__datetime__.strftime(datetime_formats['iso_format'])

# ----------------------------------------------------------------------------------------------

def string_directory(self):
def string_directory(self) -> str:

return self.__datetime__.strftime(datetime_formats['directory_format'])

Expand Down

0 comments on commit ccb93d6

Please sign in to comment.