smartsheet / smartsheet-java-sdk

Library that uses Java to connect to Smartsheet services.
Apache License 2.0
3 stars 12 forks source link

added support for Java 8 Time Framework #70

Closed ricardoalonso closed 10 months ago

ricardoalonso commented 12 months ago

With the changes into the maven dependencies, we can now use the Java 8 Date Time framework (LocalDate, LocalTime, LocalDatetime) to represent date/time fields and better deal with timezones.

zromano commented 11 months ago

Hey @ricardoalonso can you provide an example of when we would need to use this?

zromano commented 10 months ago

Closing this PR for now.

If you can provide an example of how this will add value then we can revisit.

ricardoalonso commented 7 months ago

Hi @zromano , Sorry taking longer to return here, but I needed to focus on other projects.

The problem I had was when using the "old" Date java objects, and retrieving date values from a cell, where the time was irrelevant, the date was being shifted to the next one due to timezone conversion. On my sheet, I had different cells for date and time, so on Java 8 I could use objects like LocalDate and LocalDateTime that would ignore timezone and give the correct result I was expecting.

I believe the problem was in relation of the differences in the timezone from the system I was running the application and the SmartSheet servers, processing the api requests. I could only solve my problem of date shifting using the Java 8 Date and Time objects (java.time api).