0

Converting date using toChar function

Hi All,

I am trying to do calculations on current date as shown below with in IF statement, but the resulting timetsamp is wrong and is always showing as 12:08:24 irrespective of current timestamp value.

Logic:

toChar(

    addHours(

        $currentTime,

        -5

    ),

    'MM-dd-yyyy HH:mm:ss'

)

 

Thanks,

Srinivas C

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I verified that toChar() has a weird behavior. I broke the above into three formulas: $currentTime, addHours(...), and the full formula. My results show currentTime and addHours(...) correctly. Once the toChar() is applied, the time portion is off. My specific results are in the attached picture.

    Like
  • Use formatDate - 

    formatDate(

        addHours(

            $currentTime,

            -5

        ),

        'MM-dd-yyyy HH:mm:ss'

    )

    Like
  • Hi Marc & Amit,

    Thanks for the responses. "formatDate" function worked for me in my case.

    Like
Like Follow
  • Status Answered
  • 3 mths agoLast active
  • 3Replies
  • 30Views
  • 3 Following

Product Announcement

Incorta 4.9 is now Generally Available (GA)!!!