bluethrust / clanscripts

A CMS built for Clans, Guilds and Gaming Communities
http://www.bluethrust.com
Other
10 stars 9 forks source link

birthdays #16

Open osusoy opened 10 years ago

osusoy commented 10 years ago

they seem to set to 1 day before the selected date. i.e. selecting 15 Feb 1970 sets it to 14 Feb 1970.

bluethrust commented 10 years ago

Can you tell me what timezone you are using on the site? It would be set in the world clock settings page in my account. Every time I think I've fixed this one, someone else brings it up and it drives me crazy :p Basically the jquery datepicker grabs time based on UTC, and if the timezone on the server is set to something where the time difference is big enough, it screws with the date. The way I thought I had it fixed was before I saved the birthday, I switched php to use UTC, then saved then switched it back to the default timezone. When the birthday is displayed it does the same thing, it gets it based off UTC. :( doesnt seem to work though

osusoy commented 10 years ago

hmm, datepicker API page is down :/ i'll have a look later but i was getting this reported by members anywhere between UTC-9 to UTC+10. server time is UTC+10

bluethrust commented 10 years ago

ok I have a fix for this, will be pushing it out after I post this. rather then getting a timestamp from the the datepicker, I'm getting just the date formatted as m-d-yyyy. Then I'm parsing that in php into a timestamp so I don't have to deal with timestamps from javascript. I misread the jqueryui docs, it was the unix timestamp it returned, not utc. And since javascript gets the time I believe based on your computer, and I don't think you can set the timezone for the datepicker, it was a bad choice to use timestamp as the return value for that.