title: How to compare milliseconds in MySQL with a given date
body: <p>Using</p>
  
  <pre><code>mysql  Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (i686) using readline 5.0
  </code></pre>
  
  <p>I have a table defined like this:</p>
  
  <pre><code>+-----------------------+--------------+------+-----+---------+-------+
  | Field                 | Type         | Null | Key | Default | Extra |
  +-----------------------+--------------+------+-----+---------+-------+
  | id                    | bigint(20)   | NO   | PRI |         |       | 
  | user_id               | bigint(20)   | NO   | MUL |         |       | 
  | directory_id          | bigint(20)   | NO   | MUL |         |       | 
  | attribute_name        | varchar(255) | NO   |     |         |       | 
  | attribute_value       | varchar(255) | YES  |     | NULL    |       | 
  | attribute_lower_value | varchar(255) | YES  |     | NULL    |       | 
  +-----------------------+--------------+------+-----+---------+-------+
  </code></pre>
  
  <p>Selecting the attribute_value for my last authenticated time returns </p>
  
  <pre><code>+-------------------+-----------------+
  | attribute_name    | attribute_value |
  +-------------------+-----------------+
  | lastAuthenticated | 1330380013284   | 
  +-------------------+-----------------+
  </code></pre>
  
  <p>If I verify the value using <a href="http://www.epochconverter.com/" rel="nofollow">http://www.epochconverter.com/</a> it says</p>
  
  <pre><code>Assuming that this timestamp is in milliseconds:
  GMT: Mon, 27 Feb 2012 22:00:13 GMT
  </code></pre>
  
  <p>But if I try the following line of code</p>
  
  <pre><code>mysql&gt; select from_unixtime('1330380013284');
  +--------------------------------+
  | from_unixtime('1330380013284') |
  +--------------------------------+
  | NULL                           | 
  +--------------------------------+
  </code></pre>
  
  <p>Anyone who immediately knows what I'm missing here?</p>