A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Arduino in Action
this week in the
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
MySQL Date field , how to assign current date as default value ?
Joined: Jul 14, 2005
Sep 20, 2006 05:21:00
Thank you for reading my post
i want to ask how i can assign current date as a default value of a filed when i create the table ?
i am using mysql.
Joined: Sep 06, 2003
Sep 20, 2006 06:06:00
Hope this helps you
create table tmp (id int,created_dt timestamp default current_timestamp);
You may use insert stmt like
insert into tmp(id) values (123);
created_dt column is assigned the current date time ...Is it what you want?
I agree. Here's the link:
- it saves me about five hours per week
subject: MySQL Date field , how to assign current date as default value ?
How to use a Timestamp as the Identifier
MySQL - Date/Time and Timestamp Issues
Java date to MySQL date conversion
XSD : default current date
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013