
As my user profile is currently in IST Timezone.My Timezone Start time value is '09:00:00.000Z'.
For getting that time alone i have done a code like,
String getStartTime = String.valueOf(StartTimebh).substring(0, (String.valueOf(StartTimebh).length()-5));
So now My string variable 'getStartTime' that storing the value '09:00:00'. Actually that time is in EST.
After that i have converted that string value to DateTime.So now The System Converting that EST value to GMT value.
Now there is some problem in my code that,
'09:00:00' this value is actually EST value,But as iam in IST Timzone '09:00:00' This value(after converting to dateTime format) is taken as IST Format.How can i solve this ? So Is there any solution for doing this problem ?
Thanks,
Anjana
답변 1개
Anjana,
when you query the StartTimebh field, you can use the convertTimezone method which will convert it to your local timezone.
check this salesforce article for details
http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_convert_time_zone.htm