Downloads before upgrade are displayed as December 31, 1969, 5:33 pm
Downloads after upgrade are displayed as December 31, 1969, 5:00 pm

dl_time in database have accurate times and have this format: 2009-04-07 23:24:26

Comments

clarkburbidge’s picture

After some more investigation:

dl_time no longer gets the correct time with new downloads. The time entered into the DB is 0000-00-00 00:00:00.

I did some research on php.org and it looks like to get the date to display correctly the function strtotime() must be used on this line:

$time = date("F j, Y, g:i a", strtotime( $data->dl_time ) );

instead of this:

$time = date("F j, Y, g:i a", $data->dl_time );

I'm sure there is something similar when the download time is entered into the DB, but I'm no PHP guru and am having a hard time locating the spot where that happens. Once I find it I'll have to do my usual guess at a change, save and fail method, so any help is appreciated.

I'm on:
drupal 6.12
php 5
mysql 5

clarkburbidge’s picture

More playing around...

This sends 0000-00-00 00:00:00 to the DB:

$result = db_query($query, $user->uid, $file->fid, time());

but this at least gets the date part correct. The time remains 00:00:00:

$result = db_query($query, $user->uid, $file->fid, date("Ymd H:i:s", time()));
jadowd’s picture

Did you download and install this prior to the last patch, or have you installed from the latest release?

clarkburbidge’s picture

I installed this module prior to the latest 6.x-1.1 version. Since the move to 6.x-1.1 I've been having the problems. Originally I had to manually install the database tables as they were not installed on initial installation.

I just tried a reinstall and there still does not seem to be automatic installation of the necessary database table.

The date issue remains.

clarkburbidge’s picture

BTW: I love this module! Thanks for the great work!!!

jadowd’s picture

Okay... sorry about the lateness on this. If the module is installed fresh, I think it will work for you... however, the issue is in the column type in the database. I will get an update to the module for you asap... hopefully by week's end.

Thanks,

modiphier’s picture

Hi,
I just installed the latest release 6.x-9.x-dev (2010-Nov-12) and my time field is displayed as 1288981979 and the row Node is blank. I looked through the .module file for the code above and I dont even find it.
$time = date("F j, Y, g:i a", $data->dl_time );

the only line I find related to time is:
$today = date("m_j_Y_g_i");