• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

LocalDateTime not worked with DateTimeFormatter.ISO_OFFSET_DATE_TIME as ZonedDateTime did  RSS feed

 
Ranch Hand
Posts: 77
2
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr. Hanumant Deshmukh ,

Note: ZonedDateTime not included for OCA Exam. I just mention to compare with LocalDateTime.

I found there is a difference in working with ZonedDateTime and LocalDateTime.

LocalDateTime doesn't support DateTimeFormatter.ISO_OFFSET_DATE_TIME, but ZonedLocalDateTime does.

Here is the code:

Output is produced as follows:


What does it mean the 'OffsetSeconds' in error section?

Thank you

 
Marshal
Posts: 64493
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check the documentation for ISO_OFFSET_DATE_TIME. Maybe it requires a time object with a field representing the offset between GMT/UTC and the local time zone in seconds. You should be able to find that from the local and zone date time documentation, or there might be something in the Java™ Tutorials. About halfway down that tutorials section there is a page about time zones.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!