Converts a date-time with a region id to ZonedDateTime
All 3 scenarios hold
Cell text converts automatically to the declared parameter type. There is no type converter to write.
Every table below reads the same way. An Input value column holds the text as written in the cell. A Parameter type column holds the type the text converts to. Expectation columns state observable properties of the object the test method receives. Each row therefore shows that the text became a valid object of that type, and not merely that it converted.
The test method signature fixes a parameter type, and no row can vary it. Each type therefore gets its own short table.
Each type here fixes a point on the world timeline. Some of them instead name the offset or the zone that fixes it. A date or a time that carries neither is in the neighbouring feature.
| Scenario | Input value | Parameter type? | ZonedDateTime zone id? | ZonedDateTime as instant in UTC? |
|---|---|---|---|---|
| Region zone | 2017-03-14T13:00:00+01:00[Europe/Berlin] | java.time.ZonedDateTime | Europe/Berlin | 2017-03-14T12:00:00Z |
| Offset only | 2000-06-15T18:30:45-07:00 | java.time.ZonedDateTime | -07:00 | 2000-06-16T01:30:45Z |
| At UTC | 2025-12-25T00:00:00Z | java.time.ZonedDateTime | Z | 2025-12-25T00:00:00Z |