Inserting timestamp in MySQL DB

skaber
01-14-2004, 12:55 PM
Hello,
i need to insert values to mysql DB using the unix_timestamp function. My visual basic program works perfectly except for posting the timestamp in unix format. I was using the yyyy-mm-dd but now i have to change the format. I tried this but it doesnt work at all:
insert into pretimes values('Work','PersonID',UNIX_TIMESTAMP('1997-10-04 22:23:00');

How can i use the unix_timestamp function included in mysql to insert a value ? Or does anybody have any easier way to do it in visual basic ?

Thanks,
Francis

Squeebee
01-15-2004, 08:55 AM
insert into pretimes values('Work','PersonID',UNIX_TIMESTAMP('1997-10-04 22:23:00');

Looks to me like you are missingthe closing ):

INSERT INTO pretimes VALUES('Work', 'PersonID', UNIX_TIMESTAMP('1997-10-04 22:23:00'));

skaber
01-16-2004, 10:24 AM
thanks ! you got it right, there was missing ")" at the end
lol
thanks

Squeebee
01-16-2004, 10:26 AM
Glad I could help!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum