Jump to content

Running an SQL function on field values


justinbriggs1

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 comment
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 comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...