summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-07-08 17:30:58 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-07-08 17:30:58 -0400
commit9c681f38b742b26b841eb42bc19879cb90ac03de (patch)
tree6c1b9eb1971629cc3c42bae3bff9fd930d4af11c /projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java
parent6d46c473d41c6c47e6b8bd8c676d925e544bd378 (diff)
Add XML property lists
Implement support for the XML property lists that are the newer version of the ASCII ones. There are a few things that still need to be done, but all of the basics are there Next things - Allow collapsing a property list into a series of objects - Serialize both the property list and flattened objects to XML
Diffstat (limited to 'projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java')
-rw-r--r--projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java b/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java
index e3ea753..7a097e4 100644
--- a/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java
+++ b/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/NSDate.java
@@ -18,6 +18,7 @@ License along with this library; if not, see http://www.gnu.org
package net.wotonomy.foundation;
+import java.time.Instant;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
@@ -49,6 +50,14 @@ public class NSDate extends Date {
}
/**
+ * Create an NSDate that represents the given instant
+ * @param inst The instant
+ */
+ public NSDate(Instant inst) {
+ super(inst.toEpochMilli());
+ }
+
+ /**
* Represents the specified number of seconds from the current date.
*/
public NSDate(double seconds) {