in reply to Use mysql NOW() fuction from DBIx::Class

You are asking a MySQL question.

'SELECT NOW()' returns the value you seek.

Also, MySQL offers a timestamp field for just such a purpose, so that you don't have to pre-acquire the date.

You can construct a date value creating the well documented date syntax by the results of localtime.

Take your choice.

  • Comment on Re: Use mysql NOW() fuction from DBIx::Class

Replies are listed 'Best First'.
Re^2: Use mysql NOW() fuction from DBIx::Class
by perllove (Beadle) on Jul 16, 2007 at 02:38 UTC
    I think what snopal mentions is that while creating the table you can specify the column type as TIMESTAMP in MySQL. So then when you dealing with the table in Perl or whatever you can just ignore that column and go on working. On insertion of any value into the table, MySQL puts the time at that instant into the DB.

    If this is not you are asking, pardon me.
Re^2: Use mysql NOW() fuction from DBIx::Class
by perrin (Chancellor) on Jul 16, 2007 at 03:51 UTC
    He really is asking a DBIx::Class question. He doesn't know how to make DBIx::Class run that SQL. I don't either, but I would ask on the DBIx::Class mailing list rather than here.