Note that there are some explanatory texts on larger screens.

plurals
  1. POView hook only displays 1969 dates
    text
    copied!<p>I have a table that looks like:</p> <pre><code>+--------------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------------------+-------------+------+-----+---------+-------+ | ProductsDownloadId | int(11) | NO | PRI | 0 | | | RCContactID | int(11) | NO | MUL | NULL | | | product_name | varchar(50) | YES | MUL | NULL | | | download_date | timestamp | YES | | NULL | | +--------------------+-------------+------+-----+---------+-------+ </code></pre> <p>I'm writing a module for this table to be viewable in a Drupal 6 View.</p> <p>I followed the example I found here: <a href="http://drupalcontrib.org/api/drupal/contributions--views--docs--docs.php/function/hook_views_data/6" rel="nofollow">http://drupalcontrib.org/api/drupal/contributions--views--docs--docs.php/function/hook_views_data/6</a></p> <p>So I exposed the download_date as thus:</p> <pre><code> $data['products_downloaded']['download_date']=array( 'title'=&gt;t("Download Date"), 'help'=&gt;t("When Product was downloaded by the user"), 'field' =&gt; array( 'handler' =&gt; 'views_handler_field_date', 'click sortable' =&gt; TRUE, ), 'sort' =&gt; array( 'handler' =&gt; 'views_handler_sort', ), 'filter' =&gt; array( 'handler' =&gt; 'views_handler_filter_date', ), ); </code></pre> <p>But when I add it to a view, <em>all</em> the dates are displayed as "12/31/1969 - 19:33". And none of the dates in my table are:</p> <p><strong>EDIT</strong>: Corrected query:</p> <pre><code> mysql&gt; select count(1) from products_downloaded where download_date &lt;'2000-12-31 23:59:59.999999'; +----------+ | count(1) | +----------+ | 0 | +----------+ 1 row in set (0.04 sec) </code></pre> <p>I also did a custom date format with the format 'r' in the View and I got Wed, 31 Dec 1969 19:33:31 -0500 for all the dates.</p> <p>So what did I do wrong on my module?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload