You need to sign in to do that
Don't have an account?

Problem with date/time
HI every one,
When I changed the Time Zone in Personal Information of my salesforce account, I am able to see the date, time change in the records of Custom objects correctly. But when I am working on SOQL queries(On custom object records) ,I am unable to get modified date,time values. But its taking original date,time values only,
How to rectify this problem, so that modified date,time values may work in soql queries also.
Please let me know if you need more clarification.
Thanks in advance,
Naresh
see this link this is the solution.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_convert_time_zone.htm
Thanks,
naresh
All Answers
By default queries returns the date and time in GMT format. You can use the format method over the Date/Date time fields. This will format the value according to the currect Locale.
HI thanks for the reply.
Can you please give me the code for the solution that you have suggested.
That's a great help for me.
Thanks,
Naresh B
for(Account account : [Select createddate from Account])
String formattedDateTime = DateTime.format(account.createddate);
see this link this is the solution.
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_convert_time_zone.htm
Thanks,
naresh