Jump to content

PHP DATES NEED SOME HELP PLEASE


Orionsbelter

Recommended Posts

Hi there, i'm a newbie to PHP coding i understand the basics of php dates but i have not used it that much. However i'm currently making a new website whereas i seem to be using the date function alot.

 

I'm in the UK and so is the Website so i'm using gmdate functions. However i would like to know if there is any tutorials about using dates to a advanced extend.

 

I would start to make scripts that will show results of maybe news posted between Y Date - X Date! however i can store the dates in the database but can not make a script that will for example only echo results for Y Date - X Date!

 

Or maybe a script that would only show news from march 2010.

 

If show one can show me how or provide links to articles i will be very thankful.

 

Thank you for reading :D

Link to comment
https://forums.phpfreaks.com/topic/197280-php-dates-need-some-help-please/
Share on other sites

SET GLOBAL time_zone = <timezone>; -- if something different from SYSTEM or if you SQL server is not hosted on the same server as your PHP

SELECT * FROM table WHERE date BETWEEN date_y AND date_x

SELECT * FROM table WHERE month(date) = 3 -- March

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.