tibberous Posted December 18, 2008 Share Posted December 18, 2008 I need to get all of the records from the last 30 days. I was hoping to do math on dates like a normal timestamp, but mysql handles them weird. December 15, 2008 is 20081215 -- YYYYMMDD Can't do math on it. Is there a way to get dates in a format I can do math on? Like, as days from the epoch or something? Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted December 18, 2008 Share Posted December 18, 2008 How you store your datetime in table field. Quote Link to comment Share on other sites More sharing options...
tibberous Posted December 18, 2008 Author Share Posted December 18, 2008 It's just a date. Quote Link to comment Share on other sites More sharing options...
haku Posted December 18, 2008 Share Posted December 18, 2008 That doesn't help at all. A date can look like any of these: 12/02/2008 2008/12/02 Dec 2 2008 December Second two-thousand-eight 448293582 And it can be in a date field or a text field or an int field (or more) in a database. So give us more info. Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted December 18, 2008 Share Posted December 18, 2008 Exactly what haku says. Quote Link to comment Share on other sites More sharing options...
tibberous Posted December 18, 2008 Author Share Posted December 18, 2008 No, I mean, it's just a mysql date type. It's formatted as 1987-02-13. I think I figured it out - gotta use the datediff function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.