Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Formula field for a created time field

Topic Labels: Dates & Timezones
306 1
cancel
Showing results for 
Search instead for 
Did you mean: 
SamuelJ
4 - Data Explorer
4 - Data Explorer

Hi I have two fields ie a created time field and a formula field for the time field. I have an issue with time displayed in the formula field. It seems to convert the time I don't know why,, here is the formula: IF( {Posting Date} > NOW(), "Posted: Timestamp is in the future", "Posted " & IF( DATETIME_DIFF(NOW(), {Posting Date}, 'seconds') < 60, DATETIME_DIFF(NOW(), {Posting Date}, 'seconds') & " seconds ago", IF( DATETIME_DIFF(NOW(), {Posting Date}, 'minutes') < 60, DATETIME_DIFF(NOW(), {Posting Date}, 'minutes') & IF(DATETIME_DIFF(NOW(), {Posting Date}, 'minutes') = 1, " minute ago", " minutes ago"), IF( DATETIME_DIFF(NOW(), {Posting Date}, 'hours') < 24, DATETIME_DIFF(NOW(), {Posting Date}, 'hours') & IF(DATETIME_DIFF(NOW(), {Posting Date}, 'hours') = 1, " hour ago", " hours ago"), IF( DATETIME_DIFF(NOW(), {Posting Date}, 'days') = 1, "Yesterday at " & DATETIME_FORMAT({Posting Date}, 'h:mm A'), IF( DATETIME_DIFF(NOW(), {Posting Date}, 'days') < 7, DATETIME_FORMAT({Posting Date}, 'dddd'), IF( YEAR(NOW()) = YEAR({Posting Date}), DATETIME_FORMAT({Posting Date}, 'dddd, MMM D'), DATETIME_FORMAT({Posting Date}, 'dddd, MMM D YYYY') ) ) ) ) ) ) )

1 Reply 1

Assuming you're talking about the ones for "Yesterday":

Screenshot 2024-11-24 at 9.49.56 PM.png 
That's probably due to a timezone setting and I'd recomend trying to set the "Posting Date" timezone to be GMT

As an example, here it is in +8:

Screenshot 2024-11-24 at 9.50.32 PM.png

And here's your formula with GMT:

Screenshot 2024-11-24 at 9.50.23 PM.png