Jump to content

Running an SQL function on field values

Recommended Posts

Hey everyone, just a quick question. I am attempting to convert some string values intoa date format, but I can't seem to figure out how to do it with one statement. Here is what I have:UPDATE student_apps_copy SET submitdate = STR_TO_DATE(submitdate,'%d,%m,%Y')This doesn't work obviously, but maybe you can see what I am trying to do.Any help would be appreciated.

Link to post
Share on other sites

I rather use $_SERVER['REQUEST_TIME'] or time(), in format like this 1292009343, which is standard, and it started counting secs from Thu Jan 01 01:00:00 1970. So it means that 1292009343 seconds passed from 1.1.1970. And it's equal to this: Fri Dec 10 20:29:03 2010Later, when u call that number from sql, u don't need use format like u have inserted. example: 12/10/2010Just use date() with proper parameters.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...