function parseDate(option, optstr, arg) {
    assert.string(arg, 'arg');
    var date;
    if (/^\d+$/.test(arg)) {
        // epoch seconds
        date = new Date(Number(arg) * 1000);
    /* JSSTYLED */
    } else if (/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?Z?)?$/i.test(arg)) {
        // ISO 8601 format
        date = new Date(arg);
    } else {
        throw new Error(format('arg for "%s" is not a valid date format: "%s"',
            optstr, arg));
    }
    if (date.toString() === 'Invalid Date') {
        throw new Error(format('arg for "%s" is an invalid date: "%s"',
            optstr, arg));
    }
    return date;
}
Supported date args:
- epoch second times (e.g. 1396031701)
- ISO 8601 format: YYYY-MM-DD[THH:MM:SS[.sss][Z]]
     2014-03-28T18:35:01.489Z
     2014-03-28T18:35:01.489
     2014-03-28T18:35:01Z
     2014-03-28T18:35:01
     2014-03-28