old_contents: from __future__ import absolute_import, division, print_function
  
  import datetime
  import dateutil
  
  
  def get_datestamp(ts_to_format=None, format_string="%Y%m%d"):
      if ts_to_format is None:
          ts_to_format = datetime.datetime.now()
      else:
          if is_date(ts_to_format):
              ts_to_format = dateutil.parser.parse(ts_to_format)
      return ts_to_format.strftime(format_string)
  
  
  def is_date(string):
      try:
          dateutil.parser.parse(string)
          return True
      except ValueError:
          return False
  
new_contents: from __future__ import absolute_import, division, print_function
  
  import datetime
  from dateutil import parser
  
  
  def get_datestamp(ts_to_format=None, format_string="%Y%m%d"):
      if ts_to_format is None:
          ts_to_format = datetime.datetime.now()
      else:
          if is_date(ts_to_format):
              ts_to_format = parser.parse(ts_to_format)
      return ts_to_format.strftime(format_string)
  
  
  def is_date(string):
      try:
          parser.parse(string)
          return True
      except ValueError:
          return False
  
subject: Fix dateutil.parser wierd import bug. https://stackoverflow.com/questions/23385003/attributeerror-when-using-import-dateutil-and-dateutil-parser-parse-but-no