Forums

This topic is locked

Need help getting dates correct...in mySQL

Posted 26 Oct 2007 00:42:00
1
has voted
26 Oct 2007 00:42:00 Timothy Dempski posted:
I am working on building a list of upcoming events, the problem is that I have no idea how to get the column of year, month, and day to display as one functional date that would work with CURRENT_DATE or CURDATE.

I am trying to make the dates that passed dissipater and the future dates appear.

SELECT *, CURRENT_DATE
FROM pec_mssgs.y, pec_mssgs.m, pec_mssgs.d
WHERE


Example: of what I am thinking

WHERE Year + MONTH + DAY >= CURRENT_DATE

I want the values to interact as dates. If someone could help me out that would be great.

Edited by - gothemknight on 26 Oct 2007 00:43:05

Replies

Replied 30 Oct 2007 12:07:05
30 Oct 2007 12:07:05 Alan C replied:
I always have trouble with dates, one way to handle them that makes the arithmetic easy is to store then as unix era times, that stores seconds from 1 Jan 1970, it can take a huge number so it caters for dates up to about 2035 once you store your dates like that it's very easy to compare etc.
There are php functions for converting too

Reply to this topic