View Full Version : datetime now
castali
03-24-2004, 04:04 PM
in Mysql Control Center I have created a column DateTime
the default value shown is 0000-00-00 00:00:00
I have try to change it by now but it doesn't work
how can you get automaticly the current time ?
thank you
You can't. You can only set a fixed value as default.
If you want to insert the current datetime, when a record is created then you need to include it in the insert statement. Like
insert into table (var1, datetimevar) values ('vvvv',Now())
If you wan't it to be set automatically, then you can use a timestamp-column instead of a datetime. But this value will also be updated when the record is updated later on.
castali
03-24-2004, 04:49 PM
ok .. thank you .. in access you can without inserting fill automaticly a column with a NOW value
In the moment I am trying dataStudio, MySql control Center, DBDesigner4
I succed nearlly only with MySql control Center ...
do you know if you can Export the full SQL file to create a database with tables and content , with MySql control Center ? like it is possible to do with MS SQL 2000
Originally posted by castali
ok .. thank you .. in access you can without inserting fill automaticly a column with a NOW value
Yes. But that's because the db-engine rewrites the query and then updates the control (column)
mySQL is a pure DB-server, where MsAccess is a db with some development, macro's, stored procedures etc wrapt around it
Originally posted by castali
In the moment I am trying dataStudio, MySql control Center, DBDesigner4
I succed nearlly only with MySql control Center ...
do you know if you can Export the full SQL file to create a database with tables and content , with MySql control Center ? like it is possible to do with MS SQL 2000
Yes you can. It is called a dumpfile
If you would use phpmyadmin --> then check the sticky. I'm sure CC also has an export function. Maybe look through the helppages for 'dumpfile'. I'll take a look at my CC when i get home, if you don't find it yourself by then.
castali
03-24-2004, 06:03 PM
ok thks again .. I look for dumpfile
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.