diff options
author | Gordon Chung <chungg@ca.ibm.com> | 2014-03-10 16:28:21 -0400 |
---|---|---|
committer | Gordon Chung <chungg@ca.ibm.com> | 2014-03-10 17:18:30 -0400 |
commit | 3d587491e7f2bfe9bd9bc8a2b19ebc4946b963e5 (patch) | |
tree | eaf7d814e8c295f571ad23d3a813ea7c72e5d963 /pycadf/timestamp.py | |
parent | a93e2ae4d6a3412c79ddfdea5b4cfe6d7ec28d3b (diff) | |
download | pycadf-3d587491e7f2bfe9bd9bc8a2b19ebc4946b963e5.tar.gz |
add docstrings to functions
add docstrings to functions
Change-Id: I112e297d20de5026784298e93b6ff05733639a1c
Implements: blueprint document-pycadf
Diffstat (limited to 'pycadf/timestamp.py')
-rw-r--r-- | pycadf/timestamp.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pycadf/timestamp.py b/pycadf/timestamp.py index 0afd563..82383c0 100644 --- a/pycadf/timestamp.py +++ b/pycadf/timestamp.py @@ -24,6 +24,10 @@ TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z" def get_utc_now(timezone=None): + """Return the current UTC time. + + :param timezone: an optional timezone param to offset time to. + """ utc_datetime = pytz.utc.localize(datetime.datetime.utcnow()) if timezone is not None: try: @@ -36,6 +40,8 @@ def get_utc_now(timezone=None): # TODO(mrutkows): validate any cadf:Timestamp (type) record against # CADF schema def is_valid(value): + """Validation to ensure timestamp is a string. + """ if not isinstance(value, six.string_types): raise ValueError('Timestamp should be a String') |