Is CURRENT_DATE subject to Timezone?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Is CURRENT_DATE subject to Timezone?

Post by Jaymer »

I have a Query that uses this snippet:
Lead.Category='C' AND Lead.FollowUp=CURRENT_DATE

For a West Coast user who has Pacific TimeZone set, the items are incorrect after 12pm (midnight) EST.
Its like the CURRENT_DATE function doesn't interrogate TimeZone to adjust the time.

Am I using a function incorrectly?
Is this supposed to be supported somehow?

thx
jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
idpSteve
Posts: 201
Joined: Thu Jul 27, 2017 6:13 am
Location: Johannesburg, South Africa
Contact:

Re: Is CURRENT_DATE subject to Timezone?

Post by idpSteve »

That's weird! From what I understand a Lead.FollowUp should always be saved in server time.. If a user on West Coast creates a lead then the follow up time should display in their time but be saved server time ...

Thinking through this:

User creates a follow up time for 18h00 on the 5th of Sept in a GMT -8 time zone.. Server time is GMT. This is saved as 02:00 on the 6th of Sept in the DB..

I guess this - Lead.FollowUp=CURRENT_DATE - would return false at 15:59 user time and return true at 16:01 ...

I think it's the user's current time that gets converted to server time rather than the server time converted to user's time..

I haven't done much with time zones..
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Is CURRENT_DATE subject to Timezone?

Post by Jaymer »

I'm not actually dealing with times (in the data).
Seeing that Leads for tomorrow appeared "Today" after 9pm at night on the WC, I added 2 HTML fields to a FORM for testing.
CURRENT_DATE and CURRENT_TIME
They both showed Server time, rather than adjusting for the LIRU TimeZone.

To me it looks like a simple oversight on the CURRENT_DATE function. I would think that it would adjust its reported time based on TZ.
And then it would have still shown Sept. 4 in California, even though server was already Sept. 5
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Is CURRENT_DATE subject to Timezone?

Post by Jaymer »

idpSteve wrote:That's weird! From what I understand a Lead.FollowUp should always be saved in server time.. If a user on West Coast creates a lead then the follow up time should display in their time but be saved server time ...
MS SQL uses timezone from the Registry.
And the getdate() function uses server time, as opposed to getutcdate()
And when I browse a SQL table (in SQL), I'm seeing a datetime as the local server time.

When browsing it in Aware, its adjusting based on my LIRU Timeszone
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Is CURRENT_DATE subject to Timezone?

Post by Jaymer »

@idpSteve
per https://www.awareim.com/forum/viewtopic.php?f=1&t=4436

from a long way back, FYI
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply