Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone conversion #268

Closed
Enngage opened this issue May 10, 2019 · 11 comments
Closed

Timezone conversion #268

Enngage opened this issue May 10, 2019 · 11 comments
Labels

Comments

@Enngage
Copy link

Enngage commented May 10, 2019

Hi,

When I'm using a where condition such as

.Where("RequestedDate > \"Fri, 10 May 2019 11:03:17 GMT\"")

the output sql query contains:

[RequestedDate] > '2019-05-10T13:03:17.0000000+02:00'

My server is running in CEST timezone and I guess that is why I get +2 hours. However, this behavior is not what I'm after as all dates in my DB are considered to be UTC and clients (browser - javascript) are providing dates always in UTC as well and thus the conversion breaks the functionality.

Is there any way to stop this behavior? Is this behavior intented?

I figured I can just omit the zone and provide Fri, 10 May 2019 11:03:17 , but this format is 'not supported' via native Javascript Date and I would have to remove it manually (which is possible and current workaround I'm using, but it doesn't feel right).

Thank you for any insights you can provide :-)

@StefH
Copy link
Collaborator

StefH commented Jun 15, 2019

I need to investigate this.

Maybe add a config setting to define the datetime parse timezone.

@Enngage
Copy link
Author

Enngage commented Jun 15, 2019

Having a config or a function that I can use to transform DateTime before it gets parsed would be awesome!

@StefH
Copy link
Collaborator

StefH commented Jun 16, 2019

I've added a new config setting DateTimeIsParsedAsUTC which should be set to true in your case.

Try latest preview NuGet from:
1.0.18-ci-11429

(https://github.com/StefH/System.Linq.Dynamic.Core/wiki/MyGet-preview-versions)

@Enngage : can you test ?

@StefH StefH added the feature label Jun 17, 2019
@StefH
Copy link
Collaborator

StefH commented Jun 27, 2019

@Enngage did you have time to test this?

@StefH
Copy link
Collaborator

StefH commented Jul 11, 2019

@Enngage Did you have time to test this MyGet ?

@StefH
Copy link
Collaborator

StefH commented Aug 1, 2019

@Enngage Can you please test this ?

@StefH
Copy link
Collaborator

StefH commented Aug 15, 2019

#277

@tludusan
Copy link

Hello @StefH.

We have tested your change from PR #277. This seems to work very well, except for the case when the fields are of type nullable DateTime. Can this be fixed for nullable types as well?

PS: We would like to use your fix ASAP, when do you plan to have this merged?

Thanks,
Tudor

@StefH
Copy link
Collaborator

StefH commented Aug 29, 2019

Can you please test 1.0.19-ci-11834 on myget? This one should fix nullable datetime

@tludusan
Copy link

We have tested this and it seems to work great for both DateTime and nullable DateTime now. For some reason we weren't able to find the 1.0.19-ci-11834 version from myget, but we built the sources from the branch locally, and we manually copied the DLLs.

I've noticed that the all checks have passed for PR #277. Do you have an ETA for when this will be merged? Thanks!

@StefH
Copy link
Collaborator

StefH commented Aug 29, 2019

ETA = soon

@StefH StefH closed this as completed Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants