Activity Forums Salesforce® Discussions How can we get time from Date Time field in Salesforce?

  • Kumar

    Member
    February 10, 2017 at 11:11 am

    Hi Sushant,

    Try this formula, this works for any timezone (simply replace the +10 with whatever your timezone is relative to GMT):

    IF(
    ISBLANK(Departure_Date_Time__c ),"0",
    TEXT(MOD(VALUE(
    Left(
    right( trim(TEXT(Departure_Date_Time__c) ),9),2))+10,24))
    &":"&mid(right( trim(TEXT(Departure_Date_Time__c) ),9),4,2)
    )

    Replaced 'Departure_Date_Time__c' with your datetime field, hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos