diff --git a/src/clj_hl7_fhir/util.clj b/src/clj_hl7_fhir/util.clj index 833ade6..1a0b619 100644 --- a/src/clj_hl7_fhir/util.clj +++ b/src/clj_hl7_fhir/util.clj @@ -8,6 +8,7 @@ (def tz (TimeZone/getDefault)) (def iso8601-timestamp "yyyy-MM-dd'T'HH:mm:ssXXX") +(def iso8601-local-timestamp "yyyy-MM-dd'T'HH:mm:ss") (def iso8601-date "yyyy-MM-dd") (defn format-date [^Date date ^String format] @@ -21,6 +22,13 @@ [^Date date] (format-date date iso8601-timestamp)) +(defn ->iso-local-timestamp + "returns an ISO8601 formatted date/time string for the given date object. the timestamp + will not include any timezone information and so is appropriate for local timezone + date/times only." + [^Date date] + (format-date date iso8601-timestamp)) + (defn ->iso-date "returns an ISO8601 formatted date string for the given date object" [^Date date]