I am using the below code in the trigger to calculate due time:
Time TIME_6_PM = Time.newInstance(18, 0, 0, 0); ol.Transcript_Due__c = Datetime.newInstanceGmt(ol.Transcript_Due__c.dateGMT(), TIME_6_PM); System.debug('TranscriptDue is: ' + ol.Transcript_Due__c);
The code is for our UK users so our time zone is set to be London/EU, and it is GMT time zone. The debug info shows correctly the due time is: 2018-03-27 18:00:00 .
However, when it comes to the SObject field, it suddenly becomes 27/03/2018 19:00.
I have noticed there is a day saving time happening in Europe at 25/03, and this issue happens exactly after that point. But I don't see much connection between.
If I run the same logic in a dummy Visualforce page it displays 18:00 properly without any issue which makes me believe it is not a timezone issue. So what is going wrong here?