From 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 13 May 2008 04:22:33 +0000 Subject: Some sweeping syntax changes for consistency: (! foo) changed to ( ! foo) || changed to OR changed newline standardization code in various places from preg_replace to str_replace --- system/helpers/date_helper.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'system/helpers/date_helper.php') diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index c4f0e9a40..095e460a9 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -1,4 +1,4 @@ - '%Y-%m-%dT%H:%i:%s%Q' ); - if (! isset($formats[$fmt])) + if ( ! isset($formats[$fmt])) { return FALSE; } @@ -145,19 +145,19 @@ if (! function_exists('standard_date')) * @param integer Unix timestamp * @return integer */ -if (! function_exists('timespan')) +if ( ! function_exists('timespan')) { function timespan($seconds = 1, $time = '') { $CI =& get_instance(); $CI->lang->load('date'); - if (! is_numeric($seconds)) + if ( ! is_numeric($seconds)) { $seconds = 1; } - if (! is_numeric($time)) + if ( ! is_numeric($time)) { $time = time(); } @@ -262,7 +262,7 @@ if (! function_exists('timespan')) * @param integer a numeric year * @return integer */ -if (! function_exists('days_in_month')) +if ( ! function_exists('days_in_month')) { function days_in_month($month = 0, $year = '') { @@ -271,7 +271,7 @@ if (! function_exists('days_in_month')) return 0; } - if (! is_numeric($year) OR strlen($year) != 4) + if ( ! is_numeric($year) OR strlen($year) != 4) { $year = date('Y'); } @@ -298,7 +298,7 @@ if (! function_exists('days_in_month')) * @param integer Unix timestamp * @return integer */ -if (! function_exists('local_to_gmt')) +if ( ! function_exists('local_to_gmt')) { function local_to_gmt($time = '') { @@ -324,7 +324,7 @@ if (! function_exists('local_to_gmt')) * @param bool whether DST is active * @return integer */ -if (! function_exists('gmt_to_local')) +if ( ! function_exists('gmt_to_local')) { function gmt_to_local($time = '', $timezone = 'UTC', $dst = FALSE) { @@ -353,7 +353,7 @@ if (! function_exists('gmt_to_local')) * @param integer Unix timestamp * @return integer */ -if (! function_exists('mysql_to_unix')) +if ( ! function_exists('mysql_to_unix')) { function mysql_to_unix($time = '') { @@ -390,7 +390,7 @@ if (! function_exists('mysql_to_unix')) * @param string format: us or euro * @return string */ -if (! function_exists('unix_to_human')) +if ( ! function_exists('unix_to_human')) { function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us') { @@ -430,7 +430,7 @@ if (! function_exists('unix_to_human')) * @param string format: us or euro * @return integer */ -if (! function_exists('human_to_unix')) +if ( ! function_exists('human_to_unix')) { function human_to_unix($datestr = '') { @@ -442,7 +442,7 @@ if (! function_exists('human_to_unix')) $datestr = trim($datestr); $datestr = preg_replace("/\040+/", "\040", $datestr); - if (! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr)) + if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr)) { return FALSE; } @@ -501,7 +501,7 @@ if (! function_exists('human_to_unix')) * @param string menu name * @return string */ -if (! function_exists('timezone_menu')) +if ( ! function_exists('timezone_menu')) { function timezone_menu($default = 'UTC', $class = "", $name = 'timezones') { @@ -544,7 +544,7 @@ if (! function_exists('timezone_menu')) * @param string timezone * @return string */ -if (! function_exists('timezones')) +if ( ! function_exists('timezones')) { function timezones($tz = '') { @@ -592,10 +592,10 @@ if (! function_exists('timezones')) if ($tz == 'GMT') $tz = 'UTC'; - return (! isset($zones[$tz])) ? 0 : $zones[$tz]; + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; } } - -/* End of file date_helper.php */ + +/* End of file date_helper.php */ /* Location: ./system/helpers/date_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b