Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Converts some utils.php functions to UTC.

Converts unixtime() to use gmmktime() instead of mktime().
Converts unix2mythtime() to use gmtime() instead of time().
Adds "UTC" parameter to myth2unixtime()'s strtotime().
Removes unix2gmtmythtime(time) since it now does exactly what unix2mythtime() does.
  • Loading branch information...
commit ee941bef6d55a0381a93eb50c3a4833dc5278f8f 1 parent 8c43d8d
@daniel-kristjansson daniel-kristjansson authored
Showing with 8 additions and 16 deletions.
  1. +7 −15 includes/utils.php
  2. +1 −1  modules/tv/classes/Program.php
View
22 includes/utils.php
@@ -161,12 +161,12 @@ function nice_length($length) {
* Converts an sql timestamp into unixtime
/**/
function unixtime($sql_timestamp) {
- return mktime(substr($sql_timestamp, 8, 2), // hour
- substr($sql_timestamp, 10, 2), // minute
- substr($sql_timestamp, 12, 2), // second
- substr($sql_timestamp, 4, 2), // month
- substr($sql_timestamp, 6, 2), // day
- substr($sql_timestamp, 0, 4)); // year
+ return gmmktime(substr($sql_timestamp, 8, 2), // hour
+ substr($sql_timestamp, 10, 2), // minute
+ substr($sql_timestamp, 12, 2), // second
+ substr($sql_timestamp, 4, 2), // month
+ substr($sql_timestamp, 6, 2), // day
+ substr($sql_timestamp, 0, 4)); // year
}
/**
@@ -315,20 +315,12 @@ function fequals($lhs, $rhs) {
function myth2unixtime($mythtime) {
if (strlen($mythtime) < 1)
return '';
- return strtotime(str_replace('T', ' ', $mythtime));
+ return strtotime(str_replace('T', ' ', $mythtime), "UTC");
}
/**
* Converts a unix timestamp into a myth timestamp
/**/
function unix2mythtime($time) {
- return date('Y-m-d\TH:i:s', $time);
- }
-
-/**
- * Converts a unix timestamp into a myth timestamp
-/**/
- function unix2gmtmythtime($time) {
return gmdate('Y-m-d\TH:i:s', $time);
}
-
View
2  modules/tv/classes/Program.php
@@ -488,7 +488,7 @@ public function thumb_url($width=160, $height=120, $secs_in=-1) {
public static function get_preview_pixmap($hostname, $chanid, $starttime, $width=160, $height=120, $secs_in=null) {
return MythBackend::find($hostname)->httpRequest('Content/GetPreviewImage', array('ChanId' => $chanid,
- 'StartTime' => unix2gmtmythtime($starttime),
+ 'StartTime' => unix2mythtime($starttime),
'Height' => $height,
'Width' => $width));
}
Please sign in to comment.
Something went wrong with that request. Please try again.