Formatuje czas zgodny z formatem <b>HH:mm:ss</b> przekazany przez parametr
wywołania <code>time</code> do obiektu {@link Date}.
188077
public static final synchronized Date parseTime(String time) {
		try {
			return timeFormat.parse(time);
		} catch(ParseException e) {
			throw new RuntimeException(e);
		}
	}
855594
public static String formatHttpDate(Date date) {
		if (null == date) {
			return null;
		}
		return DatePattern.HTTP_DATETIME_FORMAT.format(date);
	}
1103914
function(date) {    
            function format(number) {
                // Format integers to have at least two digits.
                return (number < 10) ? '0' + number : number;
            }
            return '"' + date.getFullYear() + '-' +
                    format(date.getMonth() + 1) + '-' +
                    format(date.getDate()) + 'T' +
                    format(date.getHours()) + ':' +
                    format(date.getMinutes()) + ':' +
                    format(date.getSeconds()) + '"';
        }
593090
public function getRates(\DateTime $date = null)
    {
        if (null === $date) {
            $date = new \DateTime();
        }

        // Pokud je pozadan kurz pro dnesni den a jeste nebylo 14:15 zverejnim vcerejsi kurz
        if ($date->format('Hi') < 1415) {
            $date->modify('-1 day');
        }

        $cachedFileName = $date->format('Ymd').'.php';

        if (!is_dir($this->cacheDir)) {
            mkdir($this->cacheDir);
        }

        $cachedFile = $this->cacheDir.'/cnb_'.$cachedFileName;

        if (!is_file($cachedFile)) {
            $url = sprintf(self::API_URL, urlencode($date->format('d.m.Y')));
            $file = explode("\n", file_get_contents($url));

            $rates = [];

            foreach ($file as $index => $line) {
                // Datum a hlavicku souboru preskocime
                if ($index < 2) {
                    continue;
                }
                // Pokud je radek prazdny
                if (empty($line)) {
                    continue;
                }
                $rate = explode('|', $line);

                $rates[$rate[3]] = new Rate(
                    $date,
                    $rate[3],
                    $rate[0],
                    $rate[1],
                    Lib::toNumber($rate[2]),
                    Lib::toNumber($rate[4])
                );
            }
            file_put_contents($cachedFile, serialize($rates));
        } else {
            $rates = unserialize(file_get_contents($cachedFile));
        }

        // Prevedeni do objektu Rates pro lepsi pristup v sablonach
        return new Rates($date, $rates);
    }
278118
public static String dateFormat(long ts, String format, TimeZone tz) {
		SimpleDateFormat formatter = FORMATTER_CACHE.get(format);
		formatter.setTimeZone(tz);
		Date dateTime = new Date(ts);
		return formatter.format(dateTime);
	}
186601
public static String formatDate(Date date) {
		if (null == date) {
			return null;
		}
		return DatePattern.NORM_DATE_FORMAT.format(date);
	}
390863
public static synchronized String getTime(Date date) {
		if (date == null) {
			return null;
		}
		return GET_TIME_FORMAT.format(date);
	}
1293913
public function filter($value)
    {
        //domyślny format jeśli brak
        !$this->getFormat() ? $this->setFormat('d.m.Y H:i:s') : null;
        $timestamp = $value;
        //nienumeryczna
        if (!is_numeric($value)) {
            $timestamp = strtotime($value);
        }
        return date($this->getFormat(), $timestamp);
    }
1031903
@Override
  public String formatDateTime(Locale locale, Date date) {
    return DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT, locale).format(date);
  }
859025
def hour(date)
      h = date.minute >= 30 ? date.hour + 1 : date.hour
      time = [pad(h.to_s), '00'].join(':')
      [time, day(date)].join(' ')
    end
165888
function smartDate($time, $ymd = 'Y-m-d', $his = 'H:i:s') 
	{
		$r = '';
	
		if (abs(time() - $time) < 24*3600) {
			$seconds = time() - $time;
			if($seconds > 0) {
				if ($seconds > 3600) {
					$r .= floor($seconds/3600) . "小时";
				}
				$r .= ceil($seconds%3600/60) . "分钟前";
			} else {
				$seconds =  -$seconds;
				if ($seconds > 3600) {
					$r .= floor($seconds/3600) . "小时";
				}
				$r .=  ceil($seconds%3600/60) . "分钟后";
			}
		} else {
			if (date('Y-m-d', strtotime('-1 day')) == date('Y-m-d', $time)) {
				$r = '昨天';
			} elseif (date('Y-m-d', strtotime('-2 day')) == date('Y-m-d', $time)) {
				$r = '前天';
			} elseif (date('Y-m-d', strtotime('+1 day')) == date('Y-m-d', $time)) {
				$r = '明天';
			} elseif (date('Y-m-d', strtotime('+2 day')) == date('Y-m-d', $time)) {
				$r = '后天';
			} else {
				$r = date($ymd, $time);
			}
	
			$his && $r .= ' ' . date($his);
		}
	
		return $r;
	}
303003
@Override
    public String format(Date date, String mask) {
	DateTime dt = (date instanceof DateTime) ? (DateTime) date : new DateTimeImpl(date.getTime(), false);
	return format(dt, mask, null);
    }
195709
public static String
format(Date date) {
	Calendar c = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
	StringBuffer sb = new StringBuffer();

	c.setTime(date);
	sb.append(w4.format(c.get(Calendar.YEAR)));
	sb.append(w2.format(c.get(Calendar.MONTH)+1));
	sb.append(w2.format(c.get(Calendar.DAY_OF_MONTH)));
	sb.append(w2.format(c.get(Calendar.HOUR_OF_DAY)));
	sb.append(w2.format(c.get(Calendar.MINUTE)));
	sb.append(w2.format(c.get(Calendar.SECOND)));
	return sb.toString();
}
648913
@Benchmark
	@BenchmarkMode(Mode.Throughput)
	public String formatDate() {
		synchronized (SIMPLE_DATE_FORMAT) {
			return SIMPLE_DATE_FORMAT.format(DATE);
		}
	}
545502
public function formatDate($date)
    {
        // Get format
        $format = 'date_format';
        if ($this->get('time') === 'yes') {
            $format = 'datetime_format';
        }
        return DateTimeObj::format($date, DateTimeObj::getSetting($format));
    }
917230
public static String formatDate(TimeType timeType, Date date) {
        return getDateFormat(timeType).format(date);
    }
544851
function formatTime(time) {
  let date = new Date(time);

  return (date.getFullYear() + '-' +
    zeroPad(date.getMonth() + 1) + '-' +
    zeroPad(date.getDate()) + ' ' +
    zeroPad(date.getHours()) + ':' +
    zeroPad(date.getMinutes()) + ':' +
    zeroPad(date.getSeconds()));

  function zeroPad(num) {
    return ('0' + num).slice(-2)
  }
}