summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ca715cd)
raw | patch | inline | side by side (parent: ca715cd)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Sep 2010 12:57:55 +0000 (12:57 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Sep 2010 12:57:55 +0000 (12:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19564 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/utils/class_tests.inc | patch | blob | history |
index e1f87a0d47ec402ec9ac52c91671935839a18618..03b7bf696a4b4465c502fc1acbb079f41bdeebd7 100644 (file)
return checkdate($matches[2],$matches[1],$matches[3]);
}
-
+ /*
+ * Compares two dates
+ *
+ * <0 => a<b
+ * 0 => a=b
+ * >0 => a>b
+ *
+ *
+ */
+ public static function compareDate($dateA, $dateB){
+ /*
+ * TODO:
+ * use $lang to check date format
+ */
+ $tstampA = strtotime($dateA);
+ if($tstampA === false){
+ trigger_error("Given date can not be converted to timestamp(".$dataA.") in function tests::compareDate.");
+ return false;
+ }
+ $tstampB = strtotime($dateB);
+ if($tstampB === false){
+ trigger_error("Given date can not be converted to timestamp(".$dataB.") in function tests::compareDate.");
+ return false;
+ }
+
+ return $tstampA-$tstampB;
+ }
/* \brief Check if the specified IP address $address is inside the given network */
public static function is_in_ip_range($from, $to, $address)
{