ztfy/utils/date.py
changeset 48 d9a45c366c6c
parent 2 20f3c0eb8fdf
child 68 c37867f75a54
equal deleted inserted replaced
47:ad9c8c79b9d0 48:d9a45c366c6c
       
     1 ### -*- coding: utf-8 -*- ####################################################
     1 ##############################################################################
     2 ##############################################################################
     2 #
     3 #
     3 # Copyright (c) 2008 Thierry Florac <tflorac AT ulthar.net>
     4 # Copyright (c) 2008 Thierry Florac <tflorac AT ulthar.net>
     4 # All Rights Reserved.
     5 # All Rights Reserved.
     5 #
     6 #
    37     @return: input date converted to unicode
    38     @return: input date converted to unicode
    38     @rtype: unicode
    39     @rtype: unicode
    39     """
    40     """
    40     if value is not None:
    41     if value is not None:
    41         value = gmtime(value)
    42         value = gmtime(value)
    42         return unicode(value.isoformat('T'),'ascii')
    43         return unicode(value.isoformat('T'), 'ascii')
    43     return None
    44     return None
    44 
    45 
    45 
    46 
    46 def parsedate(value):
    47 def parsedate(value):
    47     """Get date specified in unicode ISO format to Python datetime object
    48     """Get date specified in unicode ISO format to Python datetime object