Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6659677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:03:39+00:00 2026-05-26T02:03:39+00:00

I have a table that looks like: +——————–+————-+——+—–+———+——-+ | Field | Type | Null

  • 0

I have a table that looks like:

+--------------------+-------------+------+-----+---------+-------+
| 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    |       |
+--------------------+-------------+------+-----+---------+-------+

I’m writing a module for this table to be viewable in a Drupal 6 View.

I followed the example I found here:
http://drupalcontrib.org/api/drupal/contributions–views–docs–docs.php/function/hook_views_data/6

So I exposed the download_date as thus:

    $data['products_downloaded']['download_date']=array(
       'title'=>t("Download Date"),
       'help'=>t("When Product was downloaded by the user"),
   'field' => array(
         'handler' => 'views_handler_field_date', 
     'click sortable' => TRUE,
        ), 
        'sort' => array(
               'handler' => 'views_handler_sort',
      ), 
    'filter' => array(
        'handler' => 'views_handler_filter_date',
   ), 

);

But when I add it to a view, all the dates are displayed as “12/31/1969 – 19:33”. And none of the dates in my table are:

EDIT: Corrected query:

 mysql> select count(1) from products_downloaded where download_date <'2000-12-31     23:59:59.999999';
 +----------+
 | count(1) |
 +----------+
 |        0 |
 +----------+
 1 row in set (0.04 sec)

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.

So what did I do wrong on my module?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:03:39+00:00Added an answer on May 26, 2026 at 2:03 am

    What I was able to determine was that PHP or Drupal wasn’t able to understand whatever was being returned to the processor. I messed around with a custom hook and got the value to be accepted by the DateTime constructor. From there . . . it was easy to get the date formats back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a table that looks like this: Field: msg_sent_datetime Type: datetime yet when
I have a table that looks like id Type: Auto inc-int Comment: the unique
I have a table that looks like this: Id (PK, int, not null) ReviewedBy
I have a table that looks like this: Id PageId Key Content LastUpdated ---------------------------------------------
I have a table that looks like this: ------------------------------------------------------------------- CUSTNUM (INT), ITEMNUM (INT), MONTH
I have a table that looks like this CREATE TABLE `purchases` ( `id` INT(10)
I have this table that looks like this CREATE TABLE `purchases` ( `id` INT(10)
I have a table that looks like this CREATE TABLE `time_table` ( `id` INT(10)
I have a table that looks like id, parentId, name 1, null, first 2,
I have a table that looks like this: CREATE TABLE [dbo].[StudentTime] ([StudentTimeID] [int] NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.