Date/Time Parser Layout Styles
- reference
When you create a custom date/time parser with the Couchbase Server Web Console, you must choose a specific layout style for your date/time layouts.
You can choose from the following layout styles for a date/time parser.
Date/time layouts should always be surrounded by quotes. |
Layout Style | Description | Example Layouts |
---|---|---|
flexiblego |
Date/time layouts must be provided with golang specific constants. A flexiblego date/time layout is not validated automatically by the Server Web Console. For more information about flexiblego time layout syntax, see Go Date/Time Layout Style Syntax. |
|
isostyle |
Date/time layouts must be provided as ISO date format strings, commonly used in programming languages like Java and Swift. Letters in the range A-Z and a-z are reserved for layout patterns. Any other characters are considered as a literal part of a date string. The count of pattern letters determines the specific format. For more information about isostyle time layout syntax, see ISO Style Date/Time Layout Style Syntax. |
|
percentstyle |
Date/time layouts are provided using format specifiers surrounded by Any other characters in a layout string are considered literal characters. For more information about percentstyle time layout syntax, see Percent Style Date/Time Layout Style Syntax. |
|
Go Date/Time Layout Style Syntax
flexiblego and sanitizedgo date/time layouts use the following syntax:
Date Time Component | Syntax | |
---|---|---|
Year |
4 digit year |
|
2 digit year |
|
|
Month |
Unpadded month |
|
Zero-padded month |
|
|
Full English month |
|
|
Abbreviated English month |
|
|
Unpadded day of the month |
|
|
Space-padded day of the month |
|
|
Zero-padded day of the month |
|
|
Day |
Full English day |
|
Abbreviated English day |
|
|
Space-padded 3 digit day of the year |
|
|
Zero-padded 3 digit day of the year |
|
|
Hour |
Unpadded hour (1-12) |
|
Zero-padded 2 digit hour |
|
|
AM or PM |
|
|
Minute |
Unpadded minute |
|
Zero-padded minute |
|
|
Second |
Unpadded second |
|
Zero-padded second |
|
|
Fraction of a Second |
Fraction of a second to a given number of decimal places, including trailing zeroes |
|
Fraction of a second to a given number of decimal places, removing trailing zeroes |
|
|
Time Zone |
Time zone as UTC offset |
|
Percent Style Date/Time Layout Style Syntax
percentstyle date/time layouts use the following syntax:
Date Time Component | Example | Syntax | |
---|---|---|---|
Year |
4 digit year |
2025 |
|
2 digit year |
25 |
|
|
Month |
Unpadded month |
1 |
|
Zero-padded month |
01 |
|
|
Full English month |
January |
|
|
Abbreviated English month |
Jan |
|
|
Day |
Unpadded day of the month |
2 |
|
Zero-padded day of the month |
02 |
|
|
Full English day |
Monday |
|
|
Abbreviated English day |
Mon |
|
|
Hour |
Unpadded hour (1-12) |
3 |
|
Zero-padded 2 digit hour |
03 15 |
|
|
AM or PM |
AM / PM am / pm |
|
|
Minute |
Unpadded minute |
4 |
|
Zero-padded minute |
04 |
|
|
Second |
Unpadded second |
5 |
|
Zero-padded second |
05 |
|
|
Microseconds and Nanoseconds |
Microseconds |
15:03:02.000000 |
|
Nanoseconds |
15:03:02.000000000000 |
|
|
Time Zone |
Time zone name |
UTC JST GMT |
|
Time zone as UTC offset, formatted as |
+0500 -0600 |
|
|
Time zone as UTC offset, formatted as |
+05:00 -06:00 |
|
|
Time zone as UTC offset, formatted as |
+05:00:00 +06:00:00 |
|
|
Time zone as UTC offset, formatted as |
+05 -06 |
|
|
Time zone as UTC offset, formatted as |
+050000 -060000 |
|
ISO Style Date/Time Layout Style Syntax
isostyle date/time layouts use the following syntax:
Date Time Component | Example | Syntax | |
---|---|---|---|
Year |
4 digit year |
2025 |
|
2 digit year |
25 |
|
|
Zero padded year |
02025 |
The number of Y/y/u characters determines the number of zeroes added before the 4 digit year. |
|
Month |
Unpadded month |
1 |
|
Zero-padded month |
01 |
|
|
Full English month |
January |
|
|
Abbreviated English month |
Jan |
|
|
Day |
Unpadded day of the month |
2 |
|
Zero-padded day of the month |
02 |
|
|
Full English day |
Monday |
|
|
Abbreviated English day |
Mon |
|
|
Hour |
Unpadded hour (1-12) |
3 |
|
Zero-padded 2 digit hour |
03 15 |
|
|
AM or PM |
AM / PM am / pm |
|
|
Minute |
Unpadded minute |
4 |
|
Zero-padded minute |
04 |
|
|
Second |
Unpadded second |
5 |
|
Zero-padded second |
05 |
|
|
Fractions of a second |
15:03:02.000000 |
|
|
Time Zone |
Time zone name |
UTC JST GMT |
|
Time zone as UTC offset, formatted as |
+0500 -0600 |
|
|
Time zone as UTC offset, formatted as |
+05:00 -06:00 |
|
|
Time zone as UTC offset, formatted as |
+05:00:00 +06:00:00 |
|
|
Time zone as UTC offset, formatted as |
+05 -06 |
|
|
Time zone as UTC offset, formatted as |
+050000 -060000 |
|