Hi Meena25, For add seconds use addSeconds Try the following code, it may be helpful for you: DateTime myDateTime = System.NOW(); System.debug('myDateTime-->'+myDateTime); DateTime newDateTime = myDateTime.addSeconds(4); System.debug('myDateTime-->'+newDateTime); I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too. Thanks, Ajay Dubedi
Change the Field Type to Text and try the below formula: TEXT(DATEVALUE(NOW()))+'-'+TEXT(TIMEVALUE(NOW())) It will show results like '2019-06-06-08:25:03.029'
This formula worked for me: SUBSTITUTE(TEXT(fieldname__c - 7/24), 'Z', '')
All Answers
For add seconds use addSeconds Try the following code, it may be helpful for you:
DateTime myDateTime = System.NOW();
System.debug('myDateTime-->'+myDateTime);
DateTime newDateTime = myDateTime.addSeconds(4);
System.debug('myDateTime-->'+newDateTime);
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Change the Field Type to Text and try the below formula:
TEXT(DATEVALUE(NOW()))+'-'+TEXT(TIMEVALUE(NOW()))
It will show results like '2019-06-06-08:25:03.029'
Thanks
This formula worked for me: SUBSTITUTE(TEXT(fieldname__c - 7/24), 'Z', '')