question about datetime column in mysql

This is a discussion on question about datetime column in mysql within the MySQL Database forums, part of the Database Forums category; Hey there, i tried this question in the mysql group, but have not heard anything. i have a database with ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-29-2006
nephish
 
Posts: n/a
Default question about datetime column in mysql

Hey there,
i tried this question in the mysql group, but have not heard anything.
i have a database with about 20 tables. The some of these tables have
datetime type columns in them. What i am basically wondering is if
there is a way to make a default value of now() apply if it is not
specified when the row is created.
i know this is possible with a timestamp, but is it possible with a
datetime column ? and if so, how ?

Reply With Quote
  #2 (permalink)  
Old 10-30-2006
Daz
 
Posts: n/a
Default Re: question about datetime column in mysql


nephish wrote:
> Hey there,
> i tried this question in the mysql group, but have not heard anything.
> i have a database with about 20 tables. The some of these tables have
> datetime type columns in them. What i am basically wondering is if
> there is a way to make a default value of now() apply if it is not
> specified when the row is created.
> i know this is possible with a timestamp, but is it possible with a
> datetime column ? and if so, how ?


High. I think CURRENT_TIMESTAMP is meant to work, however you'd
probably need to change your column to timestamp instead of date.

Reply With Quote
  #3 (permalink)  
Old 10-30-2006
nephish
 
Posts: n/a
Default Re: question about datetime column in mysql


Daz wrote:
> nephish wrote:
> > Hey there,
> > i tried this question in the mysql group, but have not heard anything.
> > i have a database with about 20 tables. The some of these tables have
> > datetime type columns in them. What i am basically wondering is if
> > there is a way to make a default value of now() apply if it is not
> > specified when the row is created.
> > i know this is possible with a timestamp, but is it possible with a
> > datetime column ? and if so, how ?

>
> High. I think CURRENT_TIMESTAMP is meant to work, however you'd
> probably need to change your column to timestamp instead of date.


thanks, i will check it out. I had actually considered using a time
stamp, but did not know enough about it when i started to build.

thanks again

sk

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:30 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0