TOPIC:

Special Project Inquiry 1 week 6 days ago #249641

  • Topic Author
  • sprockt012
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 96
  • Thanks: 0
As you folks (shout out to Marcus!) have been always so responsive to questions and clearly have a mastery over all things PHP, SQL, Javascript, etc., I was curious if you are available to work on a coding script for me and wanted to request a quote if this request will be time consuming. I suspect it's easy for someone who knows the languages well but I am just spinning in circles.

Basically I am running in to an issue where MySQL server timezone is 4 hours off from my server timezone. I have three very basic SQL statements saved within MyAdminPHP that created views and they work to compare two dates in terms of "WHERE mydatefield = CURDATE()". But at 8pm each night, the statement determines that the current date is the next day so there is a 4 hour gap when "CURDATE()" doesn't match the day from "mydatefield".

I reached out to my host but they told me I cannot update the timezone on MySQL. THey told me I should update the timezone via PHP on my website. That doesn't sound right to me as I don't want the records to be marked as the wrong timezone.

From what I'm reading it sounds like I may have to develop the script within PHP and run it on the clientside rather than serverside which is what I had been doing. I have no idea how to convert my three serverside SQL statements to one PHP that will work. Here are my three mySQL queries that I suspect would have to be combined in to one:

I can send my [very basic] scripts if that helps to give you an idea of the scope of the coding.

Thanks!

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

Special Project Inquiry 1 week 6 days ago #249642

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1786
  • Karma: 3
  • Thanks: 158
Hi,

you can change timezone inside php.ini
date.timezone =

You want to create script that convert timezone on clientside?
Ofc, you can send your scripts for idea (I think I know what I need to do but your script comes in handy too) :)

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Special Project Inquiry 1 week 5 days ago #249701

  • Topic Author
  • sprockt012
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 96
  • Thanks: 0
Hi Tihana,

While I'll fully admit I don't know all the implications of changing timezone in php.ini, to me that doesn't sound like what I want to do as my website time is right, the times that show in form results is right.... It's only the MySQL time that appears to be wrong when I run a CURRENT_DATE in MySQL.

Attached should be the scripts and detail of my issue. Let me know if you have questions at all.

Thanks!

Brenna

File Attachment:

File Name: coding.doc
File Size:227 KB
Attachments:

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

Last edit: Post by sprockt012. Reason: attachment

Special Project Inquiry 1 week 2 days ago #249718

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1786
  • Karma: 3
  • Thanks: 158
Hi,

ahaa I understand.
Maybe you need to change timezone in mysql server:
dev.mysql.com/doc/refman/5.7/en/time-zone-support.html

Also, I will look your attached file and get back to you

P.S: on Monday I'm pretty busy so remind me if you see that there is no answer later :)

Regards,
Tihana

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

Last edit: Post by tihana.krivic.
  • Page:
  • 1
Time to create page: 0.046 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!