aboutsummaryrefslogtreecommitdiffstats
path: root/functions/date_functions.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-28 19:30:41 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-28 19:30:41 +0000
commitd482264b6af8598ce50677ac6a8f781e219b7d6f (patch)
tree5bff034467e4ed8e1b1fe442c7de643f112da7f7 /functions/date_functions.php
parentfc3e1a8590046c858b2ddebdf6c43df8240e9a97 (diff)
downloadphpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.tar.gz
phpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.tar.bz2
phpicalendar-d482264b6af8598ce50677ac6a8f781e219b7d6f.zip
fix misc bugs; rewrite some places where warnings squelched with @; require php5.1 or greater
Diffstat (limited to 'functions/date_functions.php')
-rw-r--r--functions/date_functions.php38
1 files changed, 2 insertions, 36 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php
index c03c5ae..fa8cdd9 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -1,18 +1,8 @@
<?php
+require_once(BASE."functions/is_daylight.php");
// date_functions.php
// functions for returning or comparing dates
-// not a date function, but I didn't know where to put it
-// for backwards compatibility
-if (phpversion() < '4.1') {
- function array_key_exists($key, $arr) {
- if (!is_array($arr)) return false;
- foreach (array_keys($arr) as $k) {
- if ("$k" == "$key") return true;
- }
- return false;
- }
-}
// takes iCalendar 2 day format and makes it into 3 characters
// if $txt is true, it returns the 3 letters, otherwise it returns the
@@ -290,28 +280,4 @@ function match_tz($data){
if (strpos(" $data",$key) > 0) return $key;
}
return $data;
-}
-
-require_once(BASE."functions/is_daylight.php");
-/* function is_daylight($date, $timezone) returns 1 if daylight time, 0 if not
-
- default is to use the server's date function. This will be off when the timezone's rules are not the same as the server's rules. In php5.2+ there seems to be a better way to do this, but we can't count on users having php5.2+.
-
- Although we set dt_start and st_start in parse_tzs.php, these are not rrules and I don't know how to use them yet. So we'll do it by brute force for the ones we know about, from: http://www.webexhibits.org/daylightsaving/g.html
-
- Note that this sends a screwy time value - it's not necessarily UTC unixtime, since the mktime functions that create the time are not using the timezone.
-
-function is_daylight($time, $timezone){
- global $tz_array;
- # default to std time, overwrite if daylight.
- $dlst = 0;
- switch ($timezone){
- default:
- $dlst = date('I', $time);
- }
-
- return $dlst;
-
-}
-*/
-?> \ No newline at end of file
+}?> \ No newline at end of file

© 2014-2024 Faster IT GmbH | imprint | privacy policy