IJMacD / rfc3339-iso8601

https://ijmacd.github.io/rfc3339-iso8601
291 stars 11 forks source link

Covering edge cases #18

Open Crissov opened 5 months ago

Crissov commented 5 months ago

I currently don’t have a copy of ISO 8601 available to check, but I remember wondering, when I read it, whether a fully fractional time was valid, e.g. …T12:00 = …T,5.

I also wondered whether a timezone-only time (with or without a date) was valid, particularly …TZ and …T+00.

IJMacD commented 5 months ago

You can view a copy here: https://web.archive.org/web/20230824043513/https://ipfs.io/ipfs/QmQPxkZQbHtc6AzFCb4sbz4hFC6sYgsr1xoyjNUwi4eFRW

Times are permitted with only a single component (hours) which includes fractional digits, but two leading zeroes are required if the value is less than 1. See § 5.3.1.4

I think you might have been confusing fractional time components with durations. P0.5D equals 12 hours. See § 5.5.2.3

Time shift is defined and can be specified. See § 5.3.4.1. But there's no need to include T. Also there are no formats which omit all time components from a time. § 5.3.4.2