Supported date formats
Only three formats are supported: Variants of ISO 8601, RFCs 1123, 5322 and 2822 as well as Unix Epoch dates.
Group | Formats | Examples | Notes |
---|---|---|---|
ISO 8601 |
yyyy-MM-dd yyyy-MM-ddTHH:mm:ssK yyyy-MM-ddTHH:mm:ss.FFFFFFFK |
2015-09-24
2015-09-24T19:12:22Z 2015-09-24T19:12:22.0000000Z |
Supports three granularities: Date, date with time, and date with time and fractions. The timezone identifier is Z for UTC, or can be provided as +01:00 or +0100. No timezone identifier is interpreted as UTC. Time, if provided, must be in 24-hour format. |
RFCs |
ddd, dd, MMM yyyy HH:mm:ss GMT ddd, dd, MMM yyyy HH:mm:ss K |
Mon, 15 Jun 2009 20:45:30 GMT Mon, 15 Jun 2009 20:45:30 +0100 |
Variants are commonly used for HTTP date headers, such as the Last-Modified header. Day and month names must be in English, as per the RFCs. No timezone identifier is interpreted as UTC. Time must be in 24-hour format. |
Unix Epoch | A large whole number | 1443052852 | The number of seconds since 1st of January 1970 (also known as the Unix Epoch). The date will be interpreted as UTC. |
This following table shows the built-in date formats that will be accepted by Policy in a range of programming languages:
Language/environment | Format strings | Documentation | |
---|---|---|---|
.NET | O, o, R, r | Standard Date and Time Format Strings | |
RFCs | c, r | Date/Time Functions | |
Java | N/A | Java doesn't natively support ISO 8601, but the Joda-Time library does. Learn more about Custom Formatters. |