Jump to content
  • 0

SYSUTCDATETIME() not match laptop datetime




I am using date function on datapage calculated field, why the sysutcdatetime() function have a match date with my laptop date BUT have a huge different time ?

My timestamp field works fine match with my laptop datetime. just error on sql function.

Sysdatetime() = 06/26/2024 21:00:14

SysUTCdatetime() = 06/27/2024 04:00:14

Laptop datetime UTC+7, Jakarta Bangkok = 06/27/2024 11:02:14

My apps timezone = Account Default Time Zone: (UTC+07:00) Bangkok, Hanoi, Jakarta

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @IVAN88,

1) SysUTCdatetime( ) is a function to return the date and time as UTC time (Coordinated Universal Time). The 'UTC' is present in the function syntax.

2) Sysdatetime() function returns the date and time that contains the date and time of the computer on which the instance of SQL Server is running.

So, it is not the laptop datetime but the SQL Server datetime. And in Caspio it returns the datetime in UTC(-7)



The best option to return the date and time in your time zone is to use the '[@cbTimestamp]' parameter. It should be enclosed in single quotes. 

'[@cbTimestamp]' returns the date and time according to the Localization applied on the DataPage.

If your Account Default Time Zone is (UTC+07:00) Bangkok, Hanoi, Jakarta, the date/time will be returned in UTC+07:00

Formula example: DateDiff (minute, [@field:PaymentDate], '[@cbTimestamp]')


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...