I've got dates in my database which will be set and used for Pacific/Auckland time.

My server is on American time. How can I run a query like this and have it determined by Pacific time?

SELECT * FROM mytable WHERE DATE_FORMAT(StartDate, '%Y-%m-%d') < CURDATE() AND DATE_FORMAT(EndDate, '%Y-%m-%d') > CURDATE()

    Depends what "determined by" means, but twenty seconds with the MySQL manual tells me it has a CONVERT_TZ function.

      3 months later
      Write a Reply...