Jump to content
Larry Ullman's Book Forums

How To Check Against A Datetime Field Type?


Recommended Posts

Hi all,

 

I have a table with these fields :articalID, articalTitle, articalBody, articalPhoto, articalTags, articalPublishDate, articalView, articalVisible, userID, catID

 

The articalPublishDate is a datetime type. FROM the CMS I set the date and times when the artical to be released or published. How do compare the articalPublishDate with the date and time now and select the row if date and time now equal or greater than the date and time in the table?

Link to comment
Share on other sites

I know it is in the manual but the odd thing that it doesn't include today's post for some reason.

for example: if I have post with these dates 2011-11-22, 2011-11-24, 2011-11-19, 2011-11-18

It only select 2011-11-19, 2011-11-18 but not 2011-11-22

Link to comment
Share on other sites

Yes, it is the time problem.

I set the time to a different time zone that the server uses.

I get my data insert with the date and time I want, but when I use now() in my query to select rows with them time I want, it uses the server time.

 

How do I fix this?

Link to comment
Share on other sites

 Share

×
×
  • Create New...