ChrisASearles / CompLinks

0 stars 0 forks source link

Time zone issues #184

Closed robgpeak closed 7 years ago

robgpeak commented 7 years ago

I looks like the time zone is off for the recording of registration times. Pete Bradley from dover downs signed up for an account today, but it is not showing EST

As you can see the current time is 12:32PM and Pete's registration record shows 1:25PM

uploads/a4167b59-ef4a-4b95-9f11-9c1361adcb1e/Screen Shot 2017-06-06 at 12.32.47 PM.png

I am not sure where else this might be happening on the server, but again we need to make sure we are displaying and recording transactions on the same time zone.

ChrisASearles commented 7 years ago

All times should be stored in the DB as UTC and converted on the front-end for the current user. Preferred time zone needs to be added to the my account/profile page (I forget which was which) and should be defaulted to EST.

All DateTime.Now references throughout the site should be changed to DateTime.UtcNow to ensure we're storing UTC times regardless of the server's timezone.

All time objects should be converted in the business layer to the correct time zone for the user.

cgladue commented 7 years ago

Not going to make it in the initial release, site will record all times in EST for now until there is more time later.

robgpeak commented 7 years ago

@cgladue but it is not currently recording in EST. I just marked a Redemption request as completed, and you can see it is not in EST.

It was 1:45 EST when I did it, and it is showing 5:45pm Maybe that's GMT?

screen shot 2017-06-08 at 1 49 32 pm
cgladue commented 7 years ago

Its UTC time, i had set both servers to UTC in preparation to add timezone offsets, but the process is going to take quite some time to go through all the logic and do the conversions (including DST adjustment). So better off just going with EST for now and switch when there is more time. i have just adjusted the DB server and web server back to EST, try your test again.

ChrisASearles commented 7 years ago

This is a pretty important issue. Changing the server's time zone and relying on that time stamp means we also now have some records in the database with UTC time stamps and others with EST. There are limited places on the front-end where we're displaying any times and they're pretty much all limited to the admin areas. A quick find and replace on DateTime.Now with DateTime.UtcNow should take care of the time stamps we're storing.

Making this switch after the site launches is definitely more expensive than getting it right now.

I think there's a significant argument to make that this should be completed prior to releasing anything.

@robgpeak your call.

cgladue commented 7 years ago

All the data in the DB is going to be purged before go live so thats no concern.

Chad Gladue DevNull Technology, LLC

On Thu, Jun 8, 2017 at 2:22 PM, Chris Searles notifications@github.com wrote:

This is a pretty important issue. Changing the server's time zone and relying on that time stamp means we also now have some records in the database with UTC time stamps and others with EST. There are limited places on the front-end where we're displaying any times and they're pretty much all limited to the admin areas. A quick find and replace on DateTime.Now with DateTime.UtcNow should take care of the time stamps we're storing.

Making this switch after the site launches is definitely more expensive than getting it right now.

I think there's a significant argument to make that this should be completed prior to releasing anything.

@robgpeak https://github.com/robgpeak your call.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ChrisASearles/CompLinks/issues/184#issuecomment-307186684, or mute the thread https://github.com/notifications/unsubscribe-auth/AHjClUVq0-SnW4kuASuVDr3RLdS2U0DLks5sCDv7gaJpZM4Nxm1s .

robgpeak commented 7 years ago

No, still not showing EST. Cleared cache, and in fact, I logged into my robg account from a private firefox window, which I've never done before, and just marked the second one as complete, and it is still showing 6:21 instead of 2:21...

I just now saw Chris' response, and I agree that this should be fixed now to reflect EST, but what happens if we sign up a casino partner in PST. What would we be able to do then?

I think it would be great if it always appeared in the user's local time zone.

screen shot 2017-06-08 at 2 21 36 pm
cgladue commented 7 years ago

Is there a timezone setting in ebates ? if there is i dont see it

cgladue commented 7 years ago

image

can you try again rob i just did an iisreset and restart of mysql and the proper date shows up for me when i complete a redemption and also when i start a trip.

image

robgpeak commented 7 years ago

For the shopping trips, it is showing the correct time in EST.

Now when I try to mark a redemption request as completed, I get an error message. Again this is AFTER a cache clear and new log in to me robg account

screen shot 2017-06-08 at 3 11 27 pm
robgpeak commented 7 years ago

ebates shows shopping trips in PST...

screen shot 2017-06-08 at 3 04 05 pm
cgladue commented 7 years ago

try it from the partner dashboard rob, i see on the admin side it did give an error, ill fix that.

https://shop.complinks.co/partnerdashboard/redemptions

robgpeak commented 7 years ago

It's working as expected now