def METHOD_NAME(self, timestamp, reference_timestamp):
    timestamp = str(timestamp).split('.')[0]
    reference_timestamp_struct = time.strptime(reference_timestamp, '%Y-%m-%d %H:%M:%S') # %z not supported in the C runtime, and no workaround until Python 3.2
    reference_timestamp_secs = time.mktime(reference_timestamp_struct)
    if '/' in timestamp:
        timestamp = time.strptime(timestamp, '%Y/%m/%d-%H:%M:%S')
        timestamp = time.mktime(timestamp)
    elif timestamp == 'now':
        timestamp = reference_timestamp_secs
    elif timestamp[-4:] == '-ago':
        timestamp = timestamp[:-4]
        (ago, multiplier) = (timestamp[:-1], timestamp[-1])
        secs_ago = int(ago) * self.timestamp_multiplier[multiplier]
        timestamp = int(reference_timestamp_secs) - secs_ago
    timestamp = int(float(timestamp))
    timestamp = self.ms_to_secs(timestamp)
    return timestamp