| 1 | <?php |
||
| 17 | class CarbonFormat |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * RFC3339 date format. |
||
| 21 | * Example: `2005-08-15T15:52:01+00:00` |
||
| 22 | */ |
||
| 23 | public const DEFAULT = 'RFC3339'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Simple Date format. |
||
| 27 | * Example: `2005-08-15` |
||
| 28 | */ |
||
| 29 | public const DATE = 'DATE'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Simple Time format. |
||
| 33 | * Example: `15:52:01` |
||
| 34 | */ |
||
| 35 | public const TIME = 'TIME'; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Simple DateTime format. |
||
| 39 | * Example: `2005-08-15 15:52:01` |
||
| 40 | */ |
||
| 41 | public const DATE_TIME = 'DATE_TIME'; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * RFC 7231 date format. |
||
| 45 | * Example: `Mon, 15 Aug 2005 15:52:01 GMT` |
||
| 46 | */ |
||
| 47 | public const RFC7231 = 'RFC7231'; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * ISO-8601 date format. |
||
| 51 | * Example: `2005-08-15T15:52:01+00:00` |
||
| 52 | * |
||
| 53 | * Note: This format is an alias of the RFC 3339 specification: |
||
| 54 | * @see https://www.iso.org/iso-8601-date-and-time-format.html |
||
| 55 | * @see https://www.ietf.org/rfc/rfc3339.txt |
||
| 56 | */ |
||
| 57 | public const ISO8601 = 'ISO8601'; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Human readable string. |
||
| 61 | * Example: `2 days ago` |
||
| 62 | */ |
||
| 63 | public const HUMAN_READABLE = 'HUMAN_READABLE'; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param string $value |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function fromEnumeration(string $value): string |
||
| 97 | } |
||
| 98 |