summaryrefslogtreecommitdiffstats
path: root/SchedulerHelperDate.php
diff options
context:
space:
mode:
Diffstat (limited to 'SchedulerHelperDate.php')
-rwxr-xr-xSchedulerHelperDate.php12
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();