System.now function is not working as appropriate – Salesforce Apex Issue

I am using system.now() in a controller in my application. Later I have so many calculations with it. But Date time calculations are not as per timezone of my client. Why? Solution: Yes. It will happens because, System.now() returns the DateTime in GMT time zone, whereas System.now().hour() and System.now().format() are the methods of DateTime class, which return the local time zone of current logged in user. But, one thing we have to find is that System.now() will return DateTime and all other methods of DateTime will be string. It means,…

Read More