boboldehampsink / pushnotifications

DEPRECATED - Push Notifications (iOS/Android) plugin for Craft CMS
MIT License
21 stars 6 forks source link

Is the alert DateTime value in UTC? #10

Closed sandy-abrightmind closed 8 years ago

sandy-abrightmind commented 8 years ago

Is the alert datetime value that is inserted in to the database for new alerts in UTC time???

boboldehampsink commented 8 years ago

Yeah, it should listen to Craft's timezone setting as well

sandy-abrightmind commented 8 years ago

I have tried setting the timezone setting in CraftCMS and it doesn't change the datetime value that is inserted into the DB. =( I was hoping it would.

boboldehampsink commented 8 years ago

Ah, yeah thats true. The value that gets inserted in your db depends on your server time settings.

sandy-abrightmind commented 8 years ago

I have the Timezone set in the General Tab to CDT America/Chicago and it still puts the datetime as UTC. I ran into some issues the other day so that's the only reason I noticed it.

I also tried setting it in the general.php file but that didn't do anything either.

sandy-abrightmind commented 8 years ago

My server is in CDT Timezone.

boboldehampsink commented 8 years ago

That's really weird. I would'nt know why.

sandy-abrightmind commented 8 years ago

Oh... do you know where in the plugin code that it pulls in the datetime data or where it sets the Timezone?

boboldehampsink commented 8 years ago

Its Craft that does it. It's using the dateCreated column right?

sandy-abrightmind commented 8 years ago

Yes. dateCreated and dateUpdated. Both are in UTC for the notifications table.

boboldehampsink commented 8 years ago

These are default Craft columns. You should probably ask them why this is UTC.

sandy-abrightmind commented 8 years ago

Ok. Thank you. If you leave this open, I'll respond if/when I figure it out.

sandy-abrightmind commented 8 years ago

So, the standard is UTC. Basically, all data should be stored in UTC in the database. If you need to use this data elsewhere then it's best to convert it in other scripts to whatever Timezone you need.