Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.