Translate an SQL update query into Drupal language I need to convert the following query that works against a database table

"UPDATE MYTABLE SET field_temp= %s", UNIX_TIMESTAMP(field);

into Drupal language

db_update('MYTABLE')
      -&gt;fields(array(
          'field_temp' =&gt; UNIX_TIMESTAMP('field'), //or strtotime()
         ))
        -&gt;execute();


seems to be not working.

UPDATE

db_update('MYTABLE')
        -&gt;expression('field_temp',  "UNIX_TIMESTAMP('field')"),
        -&gt;execute();


will run into: 

PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 


Some more details:


'field' is datetime format type, field_type is 'int' format type
I am running this script through a hook_update_N
I am debugging it by running update.php
You need to add an expression():

db_update('MYTABLE')
  -&gt;expression('field_temp', "UNIX_TIMESTAMP(field)")
  -&gt;execute();