Returns a formatted date and time String form a timestamp value based on the
(old) Netscape cookie date format.<p>

@param time the time value to format as date
@return the formatted date
505935
synchronized public static String getOldCookieDate(long time) {

        if (OLD_COOKIE.getTimeZone() != GMT_TIMEZONE) {
            // ensure GMT is used as time zone for the header generation
            OLD_COOKIE.setTimeZone(GMT_TIMEZONE);
        }

        try {
            return OLD_COOKIE.format(new Date(time));
        } catch (Throwable t) {
            return OLD_COOKIE.format(new Date());
        }
    }
539198
private static String formatTime(long time) {
    int sec = (int) ((time / 1000) % 60);
    int ms = (int) (time % 1000);
    return String.format("%02d.%03d", sec, ms);
  }
627029
public static String format(final long time, final String format) {
		return format(time, DateTimeFormat.forPattern(format));
	}
1255725
public static java.util.Date toDate(String date, String time) {
		if (date == null || time == null)
			return null;
		String month;
		String day;
		String year;
		String hour;
		String minute;
		String second;

		int dateSlash1 = date.indexOf("/");
		int dateSlash2 = date.lastIndexOf("/");

		if (dateSlash1 <= 0 || dateSlash1 == dateSlash2)
			return null;
		int timeColon1 = time.indexOf(":");
		int timeColon2 = time.lastIndexOf(":");

		if (timeColon1 <= 0)
			return null;
		month = date.substring(0, dateSlash1);
		day = date.substring(dateSlash1 + 1, dateSlash2);
		year = date.substring(dateSlash2 + 1);
		hour = time.substring(0, timeColon1);

		if (timeColon1 == timeColon2) {
			minute = time.substring(timeColon1 + 1);
			second = "0";
		} else {
			minute = time.substring(timeColon1 + 1, timeColon2);
			second = time.substring(timeColon2 + 1);
		}

		return toDate(month, day, year, hour, minute, second);
	}
1196495
public static final String printTime(Date value)
   {
      return (value == null ? null : TIME_FORMAT.get().format(value));
   }
840043
public static String toTimeString(java.util.Date date) {
		if (date == null)
			return "";
		Calendar calendar = Calendar.getInstance();

		calendar.setTime(date);
		return (toTimeString(calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND)));
	}
858792
public static String toDateString(long time) {
		GregorianCalendar cal = new GregorianCalendar(0, 0, 0);
		cal.setTimeInMillis(time);
		return toDateString(cal);
	}
1241277
public static String timeToString(long time) {

        time += DATE_SHIFT;


        if (time < 0) {
            throw new IllegalArgumentException("time too early");
        }

        String s = Long.toString(time, Character.MAX_RADIX);

        if (s.length() > DATE_LEN) {
            throw new IllegalArgumentException("time too late");
        }

        // Pad with leading zeros
        if (s.length() < DATE_LEN) {
            StringBuilder sb = new StringBuilder(s);
            while (sb.length() < DATE_LEN) {
                sb.insert(0, 0);
            }
            s = sb.toString();
        }

        return s;
    }
88065
public String getDateTime(long time) {

        return CmsDateTimeUtil.getDateTime(new Date(time), CmsDateTimeUtil.Format.SHORT);
    }
907735
public static final Date parseDateTime(String value)
   {
      Date result = null;

      try
      {
         if (value != null && !value.isEmpty())
         {
            result = DATE_TIME_FORMAT.get().parse(value);
         }
      }
      catch (ParseException ex)
      {
         // Ignore
      }

      return result;
   }
951222
public synchronized static String formatTimeStamp(final Timestamp date, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_TIMESTAMP_PATTERN;
		}
		return JKFormatUtil.getDateFormatter(pattern).format(date);
	}
1002891
private String getTimeText() {

        String timeAsString = m_time.getText().trim();
        if (CmsDateConverter.is12HourPresentation()) {
            if (!(timeAsString.contains(CmsDateConverter.AM) || timeAsString.contains(CmsDateConverter.PM))) {
                if (m_am.isChecked()) {
                    timeAsString = timeAsString + " " + CmsDateConverter.AM;
                } else {
                    timeAsString = timeAsString + " " + CmsDateConverter.PM;
                }
            }
        }
        return timeAsString;
    }
120844
public static String formatDateTime(CmsObject cms, long date) {

        return CmsDateUtil.getDateTime(
            new Date(date),
            DateFormat.MEDIUM,
            OpenCms.getWorkplaceManager().getWorkplaceLocale(cms));
    }
850734
public function formatTime($time)
    {
        if ($this->timeFormat === null || $this->timeFormat === false) {
            return $time;
        }

        $dateTime = new \DateTime($time);

        if ($this->timeFormat === true) {
            return $dateTime;
        }

        return $dateTime->format($this->timeFormat);
    }
188077
public static final synchronized Date parseTime(String time) {
		try {
			return timeFormat.parse(time);
		} catch(ParseException e) {
			throw new RuntimeException(e);
		}
	}
207022
public synchronized static String formatTime(final Time object, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_TIME_PATTERN;
		}
		return JKFormatUtil.getDateFormatter(pattern).format(object);
	}
711351
public static String timeStampToString(final Timestamp timestamp, final String format) {
        return dateToString(new Date(timestamp.getTime()), format);
    }