Given a timezone like 'EDT' in java, is there a way to set an arbitrary datetime in java to be in that timezone and print with the correct label, (either EDT or EST)?
Some context:
I am developing a weekly report generation feature that needs to timestamp reports in the timezone of the user who first configured the report. I would like to label the reports using the 3 letter timezone labels like 'EST' or 'CST,' so that users would see a message like "This report was generated at 03-28-2018 12:00:00 pm EDT." (I realize these can be ambiguous.)
Reports are generated as pdfs on the server so all information must come from the report configuration saved in the database.
Right now when the client posts a new report configuration, it includes the three letter timezone in the configuration along with its offset (eg 'GMT-0400' for EDT), and use that to create a LocalDateTime
with the saved offset, then print it with saved label. Obviously this won't account for daylight savings, so I need a better solution.
For reference I am using AngularJS on the client.