def formatExpDateForPostgreSQL(dateStr):
    """Format the experiment date to be compatible with postgreSQL's
    'timestamp' data type.

    @param Date stored in the FCS file, in the form 01-JAN-2013
    @return Date in the form 2013-01-01
    """

    monthMapper = {'JAN': '01', 'FEB': '02', 'MAR': '03', 'APR': '04',
                   'MAY': '05', 'JUN': '06', 'JUL': '07', 'AUG': '08',
                   'SEP': '09', 'OCT': '10', 'NOV': '11', 'DEC': '12'}

    # Separate the date into day, month, and year
    (day, month, year) = dateStr.split("-")

    # Try mapping the month to digits (e.g. "06"). If the mapping does
    # not work, return "NOT_FOUND"
    month = monthMapper.get(month, "NOT_FOUND")

    # Build the date in the correct format. If the month was not found,
    # return 01-01-1970
    if month == "NOT_FOUND":
        return "1970-01-01"
    else:
        return year + "-" + month + "-" + day