Convert Datetime of one Timezone to Datetime of another Timezone

convert datetime in salesforce
convert datetime in salesforce

While availing Salesforce Services, users generally struggle to Convert Datetime Of One Timezone To Datetime Of Another Timezone. Refer to this article and know how to convert date and time to another timezone without any hassle.

Converting Datetime to another timezone

We use TimeZoneService class to convert DateTime from a timezone to another. We correct TIMEZONESIDKEY to get the timezone conversion. In case if the user enters a timezonesidkey that is either invalid or not supported, then the user will see a GMT timezone information. This makes the selection process easier. 

Click HERE to get information related to TIMEZONESIDKEY.

Use the service class that follows for timezone conversion-

  • Converting DateTime- The TimeZoneService method mentioned above can be used to change the DateTime value from one timezone to another. 
  • Convert time to another timezone- It is a general practice to save the best time to call customers in Salesforce records. Refer to the image to convert time to another timezone in the event when the best time is saved in records. 

Read more: https://nlineaxis.com/how-to-monitor-salesforce-api-limi/

Here, acct.TimeToCall__c is the object field that needs to be changed.

Following these steps can help you convert timezones with ease. However, all that you need is the Best Salesforce Consulting Services for higher accountability of your Salesforce App.Reference: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_timezone.htm

By Vaibhav Sharma

A technical graduate with a passion for writing, he has been educating readers about technical innovations and trends like blockchain, internet of things, Salesforce and much more.

Leave a comment

Your email address will not be published. Required fields are marked *