Skip to content

Instantly share code, notes, and snippets.

@kiall
Created January 24, 2012 20:33
Show Gist options
  • Save kiall/1672402 to your computer and use it in GitHub Desktop.
Save kiall/1672402 to your computer and use it in GitHub Desktop.
diff --git a/classes/kohana/date.php b/classes/kohana/date.php
index 0a2e10b..2f5aa7e 100644
--- a/classes/kohana/date.php
+++ b/classes/kohana/date.php
@@ -584,10 +584,9 @@ class Kohana_Date {
* @param string $datetime_str datetime string
* @param string $timestamp_format timestamp format
* @param string $timezone timezone identifier
- * @param bool $is_timestamp Boolean indicating if $datetime_str is a unix timestamp
* @return string
*/
- public static function formatted_time($datetime_str = 'now', $timestamp_format = NULL, $timezone = NULL, $is_timestamp = FALSE)
+ public static function formatted_time($datetime_str = 'now', $timestamp_format = NULL, $timezone = NULL)
{
$timestamp_format = ($timestamp_format == NULL) ? Date::$timestamp_format : $timestamp_format;
$timezone = ($timezone === NULL) ? Date::$timezone : $timezone;
@@ -595,11 +594,6 @@ class Kohana_Date {
$tz = new DateTimeZone($timezone ? $timezone : date_default_timezone_get());
$time = new DateTime($datetime_str, $tz);
- if ($is_timestamp)
- {
- $time->setTimestamp($datetime_str);
- }
-
if ($time->getTimeZone()->getName() !== $tz->getName())
{
$time->setTimeZone($tz);
diff --git a/classes/kohana/log/writer.php b/classes/kohana/log/writer.php
index 75f4148..3668bc1 100644
--- a/classes/kohana/log/writer.php
+++ b/classes/kohana/log/writer.php
@@ -75,7 +75,7 @@ abstract class Kohana_Log_Writer {
*/
public function format_message(array $message, $format = "time --- level: body in file:line")
{
- $message['time'] = Date::formatted_time($message['time'], Log_Writer::$timestamp, Log_Writer::$timezone, TRUE);
+ $message['time'] = Date::formatted_time('@'.$message['time'], Log_Writer::$timestamp, Log_Writer::$timezone, TRUE);
$message['level'] = $this->_log_levels[$message['level']];
$string = strtr($format, $message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment