Get Date from "yyyyMMddThhmmssZ"

@param val String "yyyyMMddThhmmssZ"
@return Date
@throws BadDateException on format error
678
public static Date fromISODateTimeUTC(final String val) throws BadDateException {
    try {
      synchronized (isoDateTimeUTCFormat) {
        return isoDateTimeUTCFormat.parse(val);
      }
    } catch (Throwable t) {
      throw new BadDateException();
    }
  }
141216
public static function dateFormat(\DateTime $val, string $format = \DateTime::ATOM): string
    {
        return $val->format($format);
    }
935474
public static java.util.Date toJavaUtilDate(Date date) {
    Calendar cal = Calendar.getInstance();
    cal.set(Calendar.HOUR_OF_DAY, 0);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    // Calender.MONTH starts from 0 while G C date starts from 1
    cal.set(date.year, date.month - 1, date.dayOfMonth);
    return cal.getTime();
  }
1164068
private String convertDate(String date) {
        SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
        try {
            Date creationDate = sdf.parse(date);
            sdf = new SimpleDateFormat("\\'yr'yyyy\\'mo'MM\\'dy'dd\\'hr'HH\\'min'mm\\'sec'ss");
            return sdf.format(creationDate);
        } catch(ParseException pe) {
            pe.printStackTrace();
            return "";
        }
    }
640702
private String getDateTimeString(Date value)
   {
      String result = null;
      if (value != null)
      {
         Calendar cal = DateHelper.popCalendar(value);
         StringBuilder sb = new StringBuilder(16);
         sb.append(m_fourDigitFormat.format(cal.get(Calendar.YEAR)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.MONTH) + 1));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.DAY_OF_MONTH)));
         sb.append('T');
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.HOUR_OF_DAY)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.MINUTE)));
         sb.append(m_twoDigitFormat.format(cal.get(Calendar.SECOND)));
         sb.append('Z');
         result = sb.toString();
         DateHelper.pushCalendar(cal);
      }
      return result;
   }
509240
public Date getSubAttrAsDate(String attrName, String dPath, String dateTimeFormat) {
        Lock lock = lockForRead();
        try {
            return JacksonUtils.getDate(getAttribute(attrName), dPath, dateTimeFormat);
        } finally {
            lock.unlock();
        }
    }
798392
public String getDate(Date date) {

        return CmsDateTimeUtil.getDate(date, CmsDateTimeUtil.Format.SHORT);
    }
397275
static ZonedDateTime getDateFromStringToZoneId(String date, ZoneId zoneId) throws DateTimeParseException {
        ZonedDateTime usDate = ZonedDateTime.parse(date).withZoneSameInstant(ZoneId.of(Constants.SHERDOG_TIME_ZONE));
        return usDate.withZoneSameInstant(zoneId);
    }
11058
public static final Date parseTimestamp(String value)
   {
      Date result = null;

      if (value != null && value.length() != 0)
      {
         try
         {
            result = TIMESTAMP_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // Ignore parse exception
         }
      }

      return (result);
   }
39520
public String getDateTime(Date date) {

        return CmsDateUtil.getDateTime(date, DateFormat.SHORT, m_locale);
    }
1008795
public static Date fromRfcDateTime(final String val,
                                     final TimeZone tz) throws BadDateException {
    try {
      synchronized (rfcDateTimeTZFormat) {
        rfcDateTimeTZFormat.setTimeZone(tz);
        return rfcDateTimeTZFormat.parse(val);
      }
    } catch (Throwable t) {
      throw new BadDateException();
    }
  }
687911
def parse_date(val, zone='default'):
    val = parse_isodate(val, None)
    '''  '''
    if not val.tzinfo:
        val = timezone[zone].localize(val)
    return val
1361842
public static String rfcDate(final Date val) {
    synchronized (rfcDateFormat) {
      try {
        rfcDateFormat.setTimeZone(Timezones.getDefaultTz());
      } catch (TimezonesException tze) {
        throw new RuntimeException(tze);
      }
      return rfcDateFormat.format(val);
    }
  }
898590
private Date getDate(final String isoFormat) {
		try {
			final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
			return dateFormat.parse(isoFormat);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
	}
1278284
public static Date str2Date(String strDate, String format) {
        Date date = null;
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        try {
            date = sdf.parse(strDate);
        } catch (ParseException e) {
            throw new TimeMatchFormatException("[" + strDate + "] parse to [" + format + "] exception", e);
        }
        return date;
    }
113096
public Date getValueAsDate(final TimeZone tz) {
        long time = ((Date) value).getTime();
        long offset;
        if(tz == null) {
            offset = TimeZone.getDefault().getRawOffset();
        } else {
            offset = tz.getRawOffset();
        }
        
        return new Date(time - offset);
    }
1091082
public static String getUtcTimeAsIso8601(Calendar cal) {
		try {
			if (cal == null) {
				return DatatypeFactory.newInstance().newXMLGregorianCalendar(
						new GregorianCalendar(TimeZone.getTimeZone("UTC")))
						.toXMLFormat().replaceAll("\\.[0-9]{3}", "");
			}

			GregorianCalendar suppliedDateCalendar =
					new GregorianCalendar(TimeZone.getTimeZone("UTC"));
			suppliedDateCalendar.setTimeInMillis(cal.getTimeInMillis());

			return DatatypeFactory.newInstance().newXMLGregorianCalendar(
					suppliedDateCalendar).toXMLFormat().replaceAll("\\.[0-9]{3}", "");
		} catch (DatatypeConfigurationException e) {
			SimpleDateFormat xmlDateUtc = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
			xmlDateUtc.setTimeZone(TimeZone.getTimeZone("UTC"));
			return xmlDateUtc.format(Calendar.getInstance());
		}
	}