cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a getutcbigdatetime()

Former Member
0 Kudos
725

Sybase provides a bigdatetime datatype

Sybase provides these functions

getdate() - returns datetime in local timezone

getutcdate() - returns datetime in utc

current_bigdatetime() - returns bigdatetime in local timezone

But there's no (unless I've missed it)

utcbigdatetime()

Is there a function I've missed - I'm using 15.7 ?

Are Sybase aiming to address this ?

Mike

Former Member
0 Kudos

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.

former_member188958
Active Contributor
0 Kudos

Hi Mike,

I've opened a new feature change request, CR 771887.

-bret


Former Member
0 Kudos

Thanks.

Accepted Solutions (0)

Answers (0)