Hello everyone. I've been working on this for a while today and I've hit a wall as to what the issue is.
Basically, I need to convert to a local time from GMT time. I am using a Calendar object, (which will contain the time in GMT format that I need to convert to local time). I am using a date (
String) formatted as yyyy-MM-dd that I need to use in the conversion process. I will also have the timezone I need to convert to (IE America/Chicago etc...). I've posted my code below but here is a summary of what I'm trying to do:
I need to convert the time in the Calendar Object to local time using the timezone I have and return a String with the time formated as HHmm. What I've been trying to do is to build a Date object by using SimpleDateFormat.parse() that will contain the date from the string, and the time from the calendar. I will then use SimpleDateFormat to format that date into the proper String with the correct converted local time. However, when I run this, it doesn't seem to convert my time. It looks like it's not using the Timezone I provide it, but keeps it at the default CENTRAL time (my local machine).
I pull the date String and build the SimpleDateFormat object as "yyyy-MM-ddTHHmm". After I build the SimpleDateFormat object, I set it's timezone to something like America/Los_Angeles and I'll put 0900 in my calendar and use 2010-03-05 for the date. I would exepect my 0900 to change to 0700 after my conversion, however it doesn't. It stays at 0900. I hope i've explained everything clearly enough, please let me know if I need to elaborate anymore.
Thank you.
Edited to remove un-necessary parts in code - can add them back if needed.