Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Is there a getutcbigdatetime()

$
0
0

Yes - We've done that but found it slightly unreliable as difference between utcdate and getdate is often 59 mins and not 60mins.

 

Run this...

select datediff(ms, getutcdate(), getdate()), datediff(minute, getutcdate(), getdate()),

 

and you often get

3599996 ms          59 s

 

In fact if you run

select

        convert(char,getdate(),109), convert(char,getutcdate(),109),

          convert(char,getdate(),109), convert(char,getutcdate(),109)

 

You get

Oct  1 2014  9:21:34:836AM     Oct  1 2014  8:21:34:840AM     Oct  1 2014  9:21:34:836AM     Oct  1 2014  8:21:34:840AM

 

 

We found this to be a solution

dateadd(hour, case when datediff(minute, getutcdate(), current_time()) >= 59 then -1 else 0 end, current_bigdatetime())

 

But should this really be necessary ?

There really should be a getutcdate which will return a bigdatetime.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>