Jump to content

[SOLVED] Is this possible... June 13, 2007 to MySQL Date?


suttercain

Recommended Posts

Hello,

 

There is a form on a clients page that allows the user to enter a date in the following format:

 

March 3, 2007

 

 

Is it possible to convert that single single string into:

 

2007-03-03

 

Thanks for your help.

 

PS. I tried strtotime with no luck.

Link to comment
Share on other sites

Does it allow them to put the date like that by a text input, or a select input?

 

It will be a lot easier if you say "select input", but if not...we can work that out too.

 

EDIT:

 

By "select input" I mean something like this:

 

<select name="month">
   <option>January</option>
   <option>Feburary</option>
   <option>March</option>
</select>


...and so on

 

Then the same thing for the month/year.

Link to comment
Share on other sites

It allows them to enter the date in a text input form. There are no drop downs. My client want to enter the date as such:

 

April 2, 2007

 

I know, I know... I would have used do downs if I could have.

 

Anyone know if this is possible? Thanks. I was thinking maybe explode???

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.