aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/08-datetime.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/08-datetime.php b/examples/08-datetime.php
new file mode 100644
index 0000000..23ae41b
--- /dev/null
+++ b/examples/08-datetime.php
@@ -0,0 +1,15 @@
+<?php
+declare(strict_types = 1);
+
+require_once __DIR__ . '/../src/ZipStream.php';
+
+# import classes
+use Pablotron\ZipStream\DateTime;
+
+# create DateTime with current timestamp
+$dt = new DateTime(time());
+
+# print DOS date and time
+echo "UNIX time: {$dt->time}\n";
+echo "DOS time: {$dt->dos_time}\n";
+echo "DOS date: {$dt->dos_date}\n";