• Advertisement
Sign in to follow this  

[web] string to date conversion in jsp

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i want to know how can i convert a String to date format (YYYY-MM-DD). to enter into mysql database. thank you.

Share this post


Link to post
Share on other sites
Advertisement
If you're just trying to do the current day, mysql has a nice NOW deal that can insert the current date/time into a date or date_time field type.

[Edited by - Omega147 on March 1, 2006 1:36:11 AM]

Share this post


Link to post
Share on other sites

my string will have a date as

yyyy-mm-dd.

i can directly entere it into mysql as string.

but i cant do any date comparision operation before i enter the date into the database..

so how can i convert the strin to date of the YYYY-MM-DD?

Share this post


Link to post
Share on other sites
Try this resource...

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

Particularly the DATE_FORMAT function described in there, which I think will give you what you want.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement