Why does today() function always returns day in GMT instead of day in the current user time zone set in profile. To overcome this we had to build a rule to return date in user time zone. Is this expected behaviour of today() function because it is no where mentioned in documentation that function always returns date in GMT
Discussion posts and replies are publicly visible
a!localVariables( local!now: now(), local!dateFormat: text(local!now, "dd MM YYYY"), local!dateSplit: split(local!dateFormat, " "), local!todayDate: date( index(local!dateSplit, 3, null()), index(local!dateSplit, 2, null()), index(local!dateSplit, 1, null()) ), local!todayDate)This logic return current system date using now() function.
Here is the one liner -> todate(text(now(), "dd-MM-YYYY"))
todate() will work according to the timezone. For a specific time, this function would return the previous day or the next day depending on the timezone.