I have a job written in Java which runs on a specified time every day on that timezone. For example if I started the job for the first time at 0800 hrs it must alwas run the job on the same time everyday. This works fine if the timezone does not follow DST. But it breaks if it follows DST.
For example if I started my job for the first time in 0800 PST, it must always run in 0000 hrs in UTC as long as DST is not in effect but should move to 2300 hrs UTC the previous day if DST is in effect. How do I adjust my job start time programatically for these DST changes.
My input looks like this:
String startdate = "2012-06-16T08:00:00"
String timeZone = "PST";
These will be constants located in a config file, and once set cannot be modified. The input will PST regardless of whether DST is in effect or not.
So if the current timezone is in PST it will run on 0000 hrs UTC 2012-06-16 or else it will run on 2300 hrs UTC 2012-06-15.
How do I achieve this.
Note: This is not a homework question and I come from a region that does not follow DST, so it is a bit confusing for me.
Thanks in advance.