Package pulp :: Package client :: Module json_utils
[hide private]
[frames] | no frames]

Module json_utils

source code

Utilities for parsing and formatting of JSON values.

Functions [hide private]
datetime.datetime instance
parse_date(date_string)
Parses the pymongo.json_util encoding of a datetime instance.
source code
Function Details [hide private]

parse_date(date_string)

source code 

Parses the pymongo.json_util encoding of a datetime instance. The instance is encoded as a 64-bit unsigned integer for milliseconds since epoch, according to JSON strict mode. This method also assumes the strict mode packaging of a dict using $date as the key for this integer.

Example: { "$date" : 1283505509571}

Parameters:
  • date_string (dict with the date integer stored at $date) - JSON encoded datetime instance
Returns: datetime.datetime instance
python object representing the date