How to determine if date / time is EDT or EST in Java?

I have a PDF that users must fill out. PDF has date and time fields. PDF instructs users to enter the date and time in the eastern format (not EST or EDT). When the user fills in the PDF, they then generate the XML from the PDF and load the XML into a Java application. The problem is that users can enter time in EDT or EST depending on the time of year (and maybe even their location?). How can I use Java to determine if the date / time from a PDF is EDT or EST, then enter it into the database as GMT.

+3
source share
1 answer

Try creating a Date using the information entered in the PDF. Then try using SimpleTimeZone.inDaylightTime (Date) to determine if you need to adjust daylight saving time.

+3
source

Source: https://habr.com/ru/post/1722694/


All Articles