SAP Knowledge Base Article - Preview

3523073 - datediff(hh) function returned unexpected value - SAP ASE

Symptom

  • In the following query, which uses datediff() to display the time(hour) difference between the local time and UTC time, the function may return an unexpected time.

    For example, current timezone is JST(UTC -9)
    So "-9" is the expected value in this case.

    *Repeat this query several times:

    1> select getdate(), getutcdate(), datediff(hh,getdate(),getutcdate())
    2> go

     ------------------------------- ------------------------------- -----------
                 Sep 24 2024  3:37PM             Sep 24 2024  6:37AM          -9   <===OK

    (1 row affected)

    1> select getdate(), getutcdate(), datediff(hh,getdate(),getutcdate())
    2> go

     ------------------------------- ------------------------------- -----------
                 Sep 24 2024  3:37PM             Sep 24 2024  6:37AM          -8    <===NG

    (1 row affected)


Read more...

Environment

  • SAP Adaptive Server Enterprise (ASE) 16.0

Product

SAP Adaptive Server Enterprise 16.0

Keywords

KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , BC-DB-SYB , Business Suite on Adaptive Server Enterprise , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.