You need to sign in to do that
Don't have an account?
Current time issues
Hi,
In user debug:
DateTime currentTime = DateTime.now();
system.debug(currentTime);
The time output is an hour late but the time stamp value is correct. my locale is BST UK.
How can I get the debug log to give me the correct uk time.
Thank you
Vida
In user debug:
DateTime currentTime = DateTime.now();
system.debug(currentTime);
The time output is an hour late but the time stamp value is correct. my locale is BST UK.
How can I get the debug log to give me the correct uk time.
Thank you
Vida
Try below code and u have other functions too
System.now() - for date time in GMT
System.today() - just the date
System.currentTimeMillis - returns the time in milli seconds
If this answers your question please mark it as solved(BestAnswer)
Thanks and Regards
sandhya
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_timezone.htm
Let us know if this will help you
Thanks
Amit CHaudhary
use same system.debug(LongDate);
Thanks and Regards
sandhya
I found that this will return you right time.
TimeZone timeZone = TimeZone.getTimeZone("London");
Try this and let us know.
Thanks and Regards
sandhya
TimeZone timeZone = TimeZone.getTimeZone('London');
The compiler says "variable doesn't exist LongDate"
string myDateTime = DateTime.now().format();
system.debug(myDateTime);
We demand that all our master jacks of all trades are completely affirmed and time-served.
You can check this out on West London handyman (https://onegoodhandyman.co.uk/)