How to avoid Time Zone issue in Apex in Salesforce?

Workaround to avoid Time Zone issue in Apex in Salesforce

        Date Dat = Date.Today();//here you can pass your date
        Date dt = Dat.dateGmt();
        Time tm = Dat.timeGmt();
        Datetime result = Datetime.newInstanceGmt(dt, tm); 

1 comment: