• JMap.Util.Date.substract

    Returns a date, that is the given date minus the given amount of unit.

    It's safe, the given date is not changed.

    Possible time units are : "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" |"years"

    Parameters

    Returns Date

    Throws

    Example

    // returns the date 2 days in the past
    JMap.Util.Date.substract(new Date(), 2, "days")

    // returns the date 2 seconds in the past
    JMap.Util.Date.substract(new Date(), 2, "seconds")