phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] property/class.functions.php, 1.1.2.3


From: nomail
Subject: [Phpgroupware-cvs] property/class.functions.php, 1.1.2.3
Date: Sun, 23 May 2004 08:29:04 -0000

Update of /property
Modified Files:
        Branch: proposal-branch
          class.functions.php

date: 2004/05/03 09:35:13;  author: sigurdne;  state: Exp;  lines: +43 -1

Log Message:
no message
=====================================================================
Index: property/class.functions.php
diff -u property/class.functions.php:1.1.2.2 
property/class.functions.php:1.1.2.3
--- property/class.functions.php:1.1.2.2        Thu Apr 29 12:49:48 2004
+++ property/class.functions.php        Mon May  3 09:35:13 2004
@@ -235,5 +235,47 @@
                                        return False;
                        }
                }
+
+               function to_timestamp($epoch)
+               {
+                       switch($GLOBALS['phpgw_data']['server']['db_type'])
+                       {
+                               case 'mssql':
+                                       return date('Y-m-d H:i:s', $epoch);
+                                       break;
+                               case 'mysql':
+                                       return date('Y-m-d H:i:s',$epoch);
+                                       break;
+                               case 'pgsql':
+                                       return date('Y-m-d H:i:s-00',$epoch);
+                                       break;
+                               case 'sybase':
+                                       return date('Y-m-d H:i:s', $epoch);
+                                       break;
+                       }
+
+               }
+
+               function from_timestamp($timestamp)
+               {
+                       switch($GLOBALS['phpgw_data']['server']['db_type'])
+                       {
+                               case 'mssql':
+                                       return strtotime($timestamp);
+                                       break;
+                               case 'mysql':
+                                       ereg('([0-9]{4})-([0-9]{2})-([0-9]{2}) 
([0-9]{2}):([0-9]{2}):([0-9]{2})',$timestamp,$parts);
+                                       return 
mktime($parts[4],$parts[5],$parts[6],$parts[2],$parts[3],$parts[1]);
+                                       break;
+                               case 'pgsql':
+                                       ereg('([0-9]{4})-([0-9]{2})-([0-9]{2}) 
([0-9]{2}):([0-9]{2}):([0-9]{2})',$timestamp,$parts);
+                                       return 
mktime($parts[4],$parts[5],$parts[6],$parts[2],$parts[3],$parts[1]);
+                                       break;
+                               case 'sybase':
+                                       return strtotime($timestamp);
+                                       break;
+                       }
+               }
+
        }
 ?>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]