You need to sign in to do that
Don't have an account?
SFDC Forum 007
Time format in hh:mm representation
Hi,
I want to represent the time in hh:mm format , i am using the following code below,
if(callReppaMap.get(ac.personContactId)!=null){
DateTime dt=System.now();
String dtStr=dt.format('HH:mm');
paDet.crdate=String.valueof(callReppaMap.get(ac.pe
rsonContactId).Date__c);
}else{
paDet.crdate='';
}
but i am getting the date as well as time, please help me with my issue.
Thanks in Advance
Try something like:
System.Now().format('hh:mm')
Hi I have tried this in Developer console , It's giving good follow this code same as well
Datetime myDT = Datetime.now();
String myDate = myDT.format('hh:mm');
System.Debug('----------->'+myDate);