diff options
author | wei <> | 2006-12-17 22:20:50 +0000 |
---|---|---|
committer | wei <> | 2006-12-17 22:20:50 +0000 |
commit | 2570226fbac3e26b1e94896b50d1db4bc1aa3308 (patch) | |
tree | 421108ccbdc0ef021e6af4fa35b1d6bcbc352b37 /demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php | |
parent | ddc0de38f64e5834ce04f0407a8416172b596655 (diff) |
Add TDataSourceConfig, TSqlMapConfig, TActiveRecordConfig
Diffstat (limited to 'demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php')
-rw-r--r-- | demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php b/demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php index 17f3e14b..03af3d36 100644 --- a/demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php +++ b/demos/time-tracker/protected/App_Data/DateTimeTypeHandler.php @@ -1,6 +1,6 @@ <?php
-class DateTimeTypeHandler implements ITypeHandlerCallback
+class DateTimeTypeHandler extends TSqlMapTypeHandler
{
/**
* Not implemented.
@@ -15,7 +15,9 @@ class DateTimeTypeHandler implements ITypeHandlerCallback */
public function getResult($string)
{
- return strtotime($string);
+ if(intval($string) > 10000) //strtotime doesn't like unix epoc time.
+ return intval($string);
+ return strtotime($string);
}
/**
@@ -27,7 +29,7 @@ class DateTimeTypeHandler implements ITypeHandlerCallback {
throw new TimeTrackerException('Not implemented');
}
-
+
}
?>
\ No newline at end of file |