function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
satish waghsatish wagh 

Event startDateTime shows more timestamp on Production

I have assigned custom timestamp to "starDateTime" standard field of event object by concatenating to custom date field but it shows additional 5:30 hours on Production.It works better in sandbox. I have following peace of code:
String selectedTime='09:00 to 09:30'
string selectedDate='2019/10/1 00:00:00';
event.DurationInMinutes=30;
string conTime = selectedTime.substring(0,5);
string conDate = selectedDate.substring(0,10);
selectedDate =selectedDate+' '+conTime+':00';
Datetime convertedDate = Datetime.valueOf(selectedDate);
event.Time_Slot__c=selectedTime;
event.StartDateTime= convertedDate;
insert event;

Above code gives right time in Start 9:00 and End 9:30 in event record but in production it shows 2:30 to 3:00. Please suggest any solution.Thanks!