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

  • How can we get time from Date Time field in Salesforce?

  • sushant

    Member
    February 9, 2017 at 2:28 pm

    Hi All,

    How can we get time from Date Time field in Salesforce?

    Thanks

  • 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.

Viewing 1 - 2 of 2 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos