Forums » MySQL » MySQL Discussion

Thread: GetDate() function equivalen on MySQL

This question is not answered. Helpful answers available: 2. Answered answers available: 1.


Permlink Replies: 2 - Pages: 1 - Last Post: Mar 21, 2011 4:17 PM by: Linda
Kparada

Posts: 1
Registered: 6/28/10
GetDate() function equivalen on MySQL
Posted: Jun 28, 2010 9:14 AM
 
  Click to reply to this thread Reply

Hi,

Ipm working with MySQl and i need to found some function that let me use the current date when i´m creating a table. On SQL Server i use the GetDate() but here i dont know which one use.

Anybody knows which one i need to use.


Thanks..



mehmet

Posts: 1
Registered: 3/20/11
Re: GetDate() function equivalen on MySQL
Posted: Mar 21, 2011 12:18 AM   in response to: Kparada
 
  Click to reply to this thread Reply

unfortunately mysql hasn't support this yet. so we cant set a function as the default value of a column in mysql create statement. :"(



Linda

Posts: 20
Registered: 2/16/10
Re: GetDate() function equivalen on MySQL
Posted: Mar 21, 2011 4:17 PM   in response to: Kparada
 
  Click to reply to this thread Reply

If you want the field to be updated automatically, you can use a timestamp datatype with "default current_timestamp" or "on update current_timestamp".

Otherwise, let me know exactly what you are trying to do.

Linda



Legend
Guru: 2001 + pts
Expert: 751 - 2000 pts
Enthusiast: 31 - 750 pts
Novice: 0 - 30 pts
Moderators
Helpful answer (5 pts)
Answered (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums