Re: Set the timestamp to current server time manually...

2009-09-02 Thread Brendon Kozlowski (Realm)
I use the following code: $this->User->saveField('lastlogin', date('Y-m-d H:i:s')); "lastlogin" is a field in my users table, so adjust your name/table accordingly. Also, if your server is not in the same timezone as you are, but you'd like it to be, you'll probably want to add the following sni

Re: Set the timestamp to current server time manually...

2009-09-02 Thread brian
If you're using Postgres or MySQL, at least, the format should be: -MM-DD HH:MM:SS So, you can use PHP's date function: $this->data['Visit']['date'] = date('Y-m-d H:i:s'); I'm not so sure that 'date' is a good name for a DB column, though. http://www.php.net/manual/en/function.date.php O

Set the timestamp to current server time manually...

2009-09-02 Thread gparra
Hi, I realize this question may be fairly easy to answer, but I just haven't managed to get a clear understanding of how to do it through the documentation or google search. I settled by using the database convention of naming my date field to 'created' as a datetime field in the database and in