Skip to content

Migrating from 1.x to 4.0, from DateTime to Temporal #664

Answered by benfortuna
alxtlst asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately the usage documentation for v4 is still quite lacking, but you can usually get a sense of how to use it from the unit tests. That said, you can assume one of three Temporal implementations to be used in DtStart/DtEnd when parsed from a file:

  1. LocalDate/LocalDateTime - when property is a date or uses a floating date-time format
  2. ZonedDateTime - when property includes a TZID parameter
  3. Instant - when property is specified in UTC (suffix is Z)

There is limited support for identifying the type, such as DateProperty.isUtc(), but the easiest way to determine the type is via an 'instanceof' check.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@alxtlst
Comment options

@benfortuna
Comment options

Answer selected by alxtlst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants