Jump to content

Selecting a date range


tibberous

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.