date from iso format or fallback
487046
function makeDateFromString(config) {
        parseISO(config);
        if (config._isValid === false) {
            delete config._isValid;
            moment.createFromInputFallback(config);
        }
    }
1047834
def ISO8601Format(dt):
   
   isoStr = dt.strftime('%Y-%m-%dT%H:%M:%S')
   if dt.microsecond:
      isoStr += ('.%06d' % dt.microsecond).rstrip('0')
   if dt.tzinfo:
      tz = dt.strftime('%z')
   else:
      if time.daylight and time.localtime().tm_isdst:
         utcOffset_minutes = -time.altzone / 60
      else:
         utcOffset_minutes = -time.timezone / 60
      tz = "%+.2d%.2d" % (utcOffset_minutes / 60, (abs(utcOffset_minutes) % 60))
   if tz == '+0000':
      return isoStr + 'Z'
   elif tz:
      return isoStr + tz[:3] + ':' + tz[3:]
   else:
      # Local offset is unknown
      return isoStr + '-00:00'
917476
def iso_datetime(timestamp=None):
    
    if timestamp is None:
        timestamp = time.time()
    return datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:19]
312512
def openTypeHeadCreatedFallback(info):
    
    if "SOURCE_DATE_EPOCH" in os.environ:
        t = datetime.utcfromtimestamp(int(os.environ["SOURCE_DATE_EPOCH"]))
        return t.strftime(_date_format)
    else:
        return dateStringForNow()
978724
def fmt_iso(timestamp):
    
    try:
        return fmt.iso_datetime(timestamp)
    except (ValueError, TypeError):
        return "N/A".rjust(len(fmt.iso_datetime(0)))
1257482
public static Dater iso(String date) {
		//Converting ISO8601-compliant String to java.util.Date
		return of(DatatypeConverter.parseDateTime(
				Strs.WHITESPACE.removeFrom(checkNotNull(date))));
	}
886443
def to_iso8601(value, strict=True, force_int=True):
    
    # split seconds to larger units
    # seconds = value.total_seconds()
    seconds = to_seconds(value, strict, force_int)

    minutes, seconds = divmod(seconds, 60)
    hours, minutes = divmod(minutes, 60)
    days, hours = divmod(hours, 24)
    days, hours, minutes = map(int, (days, hours, minutes))
    seconds = round(seconds, 6)

    # build date
    date = ''
    if days:
        date = '%sD' % days

    # build time
    time = 'T'

    # hours
    bigger_exists = date or hours
    if bigger_exists:
        time += '{:02}H'.format(hours)

    # minutes
    bigger_exists = bigger_exists or minutes
    if bigger_exists:
        time += '{:02}M'.format(minutes)

    # seconds
    if isinstance(seconds, int) or force_int:
        seconds = '{:02}'.format(int(seconds))
    else:
        # 9 chars long w/leading 0, 6 digits after decimal
        seconds = '%09.6f' % seconds

    time += '{}S'.format(seconds)
    return 'P' + date + time
288605
async def iso(self, source):
        """"""
        from datetime import datetime
        unix_timestamp = int(source)
        return datetime.fromtimestamp(unix_timestamp).isoformat()
957373
def _iso_year_start(iso_year):
    ""
    fourth_jan = dt.date(iso_year, 1, 4)
    delta = dt.timedelta(fourth_jan.isoweekday()-1)
    return fourth_jan - delta
1043149
def iso8601_date(s):
    
    try:
        return datetime.datetime.strptime(s, ISO8601_DATE_FORMAT).replace(tzinfo=pytz.utc).date()
    except (TypeError, ValueError):
        return s
642959
def iso8601_to_dt(iso8601):
    """"""
    # We could just use arrow.get() but that is more permissive than we actually want.
    # Internal (but still public) to arrow is the actual parser where we can be
    # a bit more specific
    parser = DateTimeParser()
    try:
        arrow_dt = arrow.Arrow.fromdatetime(parser.parse_iso(iso8601))
        return arrow_dt.to('utc').datetime
    except ParserError as pe:
        raise ValueError("Provided was not a valid ISO8601 string: %r" % pe)
452767
def to_iso_date(date, default=None):
    

    # not a date
    if not is_date(date):
        return default

    # handle Zope DateTime objects
    if isinstance(date, (DateTime)):
        return date.ISO8601()

    # handle python datetime objects
    return date.isoformat()
1149799
def isoformat(dt):
    """"""
    if not isinstance(dt, datetime.datetime):
        raise TypeError("Must provide datetime.datetime object to isoformat")

    if dt.tzinfo is None:
        raise ValueError("naive datetime objects are not allowed beyond the library boundaries")

    return dt.isoformat().replace("+00:00", "Z")
331247
public static String formatISO8601Date(Date date) {
        try {
            return iso8601DateFormat.print(date.getTime());
        } catch(RuntimeException ex) {
            throw handleException(ex);
        }
    }
1253550
private static String analyst(String date) {
		String style = null;
		boolean hasDiagonal = false;
		Replacer r = Replacer.of(checkNotNull(date));
		if (hasDiagonal = r.contain("/")) {
			r.update(r.lookups("/").with("-"));
		}
		
		//ISO
		if (r.containAll(".", "T")) {
			style = DateStyle.ISO_FORMAT;
		}
		//CST
		else if (r.contain("CST")) {
		    style = DateStyle.CST_FORMAT;
		}
		//GMT
		else if (r.contain("GMT")) {
		    style = DateStyle.GMT_FORMAT;
		}
		//analyst
		else {
		    switch (date.length()) {
	        case 6: style = "HHmmss"; break;
	        case 8: style = r.contain(":") ? DateStyle.HH_mm_ss : DateStyle.yyyyMMdd; break;
	        case 10: style = DateStyle.yyyy_MM_dd; break;
	        case 14: style = DateStyle.yyyyMMddHHmmss; break;
	        case 19: style = DateStyle.yyyy_MM_dd_HH_mm_ss; break;
	        }
		}
		
		return hasDiagonal ? r.set(style).lookups("-").with("/") : style;
	}
960530
function(d) {
    if (d.wyExtent) return d.wyExtent;

    // go to start of ISO week to get to the right year
    var year = later.dw.next(later.wy.start(d), 5),
        dwFirst = later.dw.val(later.Y.start(year)),
        dwLast = later.dw.val(later.Y.end(year));

    return (d.wyExtent = [1, dwFirst === 5 || dwLast === 5 ? 53 : 52]);
  }
1023847
public static Date parseFromIso8601(String s) {
        synchronized (MONITOR) {
            try {
                return ISO8601.parse(s);
            } catch (ParseException e) {
                throw new IllegalArgumentException("Unable to parse date", e);
            }
        }
    }