diff options
Diffstat (limited to 'SchedulerHelperDate.php')
-rwxr-xr-x | SchedulerHelperDate.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SchedulerHelperDate.php b/SchedulerHelperDate.php index 33635a9..a0e5f21 100755 --- a/SchedulerHelperDate.php +++ b/SchedulerHelperDate.php @@ -89,6 +89,18 @@ class SchedulerHelperDate $weekDay = getdate($timestamp)["wday"]; return $weekDay; } + + static public function getDateInfo($timestamp) + { + $result = array(); + $date = new DateTime(); + $date->setTimestamp($timestamp); + foreach (self::$DATE_UNITS as $key => $value) { + $result[$key] = $date->format($value); + } + + return $result; + } static public function addDate($timestamp, $unit, $count) { $date = new DateTime(); |