NOW_UTC Format Date Incorrect Result in Server Action

Wappler Version : 3.3.3
Operating System : Windows 10

Expected behavior

Using formatDate(‘HH:mm:ss’) should return the time part of the date.

Actual behavior

Applying this function to NOW_UTC in server action returns local time.

How to reproduce

I created two variables in server action - one is set to NOW_UTC and other is set to NOW_UTC.formatDate()

image

This is the response I get on the browser.
image

What server model are you using, as i tested on PHP and it works fine:

{
"test_utc": "12:09:11"
}

Ah. Forgot to mention. Asp.NET. Local server.

Seeing this on the dateAdd function also. Maybe other functions also have the same issue.

If you guys can give a quick fix file, or include it in today’s update, it would be really helpful. :slight_smile:

One more observation: day_next.toUTCTime() & day_next.toLocalTime() functions are causing exception too.

image

image

The toTimestamp, toLocalTime and toUTCTime where never added to ASP.NET. Will see if I can add them and check out the problem with NOW_UTC.

Here an update for you to test.

Formatter.zip (19.2 KB)

Thanks for the update. Things are working now. :slight_smile:
formatDate and dateAdd are working as expected now.
day_next.toUTCTime() and day_next.toLocalTime() both don’t throw errors anymore.

image

With day_next as UTC (1), toLocalTime() is returning UTC time (2). Running this on my local machine. So it should return in IST, just like regular NOW does.