Dates different in Membership Pro pages than source MySQL data

  • Chris Jarvis
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #165141 by Chris Jarvis
Hello.
I have found strange issue I would like some guidance with please.
I was running some queries on Members who's expiry dates weren't the end of any month like we want them to be and have noticed that the date I am looking at through Membership Pro doesn't match the dates I can see in my MySQL queries from the database table [osmembership_subscribers]
I have attached images to show you want I mean but I wondered why the dates shown don't match the table values and if the field in Membership Pro has some sort of Calendar mask going or something.
In my example if you look at image 01 you will see a member has an expiry date 28/02/2025 of when using the admin area of my Joomla website
 
When I go further into that record the dates still show the same date for expiry of 28/02/2025
 
But when I query my database table using the same ID number and finding the same persons name etc, the dates are different in the source table. It shows the expiry of 27/02/2025
 

I have found many more where the date of expiry doesn't match the same date shown in the membership pro screens as is coming our of my MySQL query but they are the same people and same subscription records. They have the correct unique ID's and they are always the people I expect them to be - but the dates and times are different.

I found this because I was running some admin reports for people who have not backdated the expiry date to the end of the month and it showed me the dates seem to be different in Membership Pro pages to the database table values.

Can I get some help as why or what I can do to show the date I have in the tables or where the difference is coming from?

Thanks
Last edit: 1 month 3 weeks ago by Chris Jarvis.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #165142 by Tuan Pham Ngoc
The difference comes from timezone. The data in database is stored in UTC timezone and when it is being displayed in Membership Pro, the system automatic convert the data to user's timezone (by default it's your site timezone)

So if you build some kind of custom report, you must handle this timezone difference if needed

Tuan

Please Log in or Create an account to join the conversation.

  • Chris Jarvis
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 month 3 weeks ago - 1 month 3 weeks ago #165143 by Chris Jarvis
That is a new world record for support Tuan!!!
Wow!
You had replied before I finished making edits to my question.

JoomDonation is the best.
If anyone else sees this post and doesn't think we get the best support for our yearly fee, then this is proof we do!

You are the best. This is the best.

One question though sorry - so do I need to speak to my web hosts to get the database storing dates in my timezone to match the membership pro dates?

Or I suppose I could just add on my time difference hours to UTC in my queries to get the match?

Just so I can understand Tuan. Are you saying my database data is in UTC times?

Thanks so much
Last edit: 1 month 3 weeks ago by Chris Jarvis.

Please Log in or Create an account to join the conversation.

More
1 month 3 weeks ago #165144 by Tuan Pham Ngoc
Hi Chris

As the data is stored in UTC timezone, you will have to adjust the code you are using to build the report/queries to handle this timezone difference. It's your jobs to do the change, the web hosts have nothing to do with this timezone issue

Tuan

Please Log in or Create an account to join the conversation.