1
JMorris
Last Update: 1969/12/31?!
  • 2005/2/19 5:14

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


I'm in the process of manually migrating data over from a PHP-Nuke site to a XOOPS site (Using phpMyAmdin). I was working on the links when I discovered the following when viewing the links.

Quote:
Last Update: 1969/12/31 19:33


I've searched through the entire table structure for mylinks and have yet to find this value. Short of going through all 175 links and manually updating them, does anybody have a clue how to make this date show the current day?

Thanks in advance!

2
Dave_L
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:10

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


That's the result of interpreting a Unix timestamp (seconds since 1970-01-01 00:00:00 GMT) that's a small value. Check the column mylinks_links.date.

3
JMorris
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:14

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


That's the kicker, when I check mylinks_links.date, the original post date is inserted correctly, but when the site parses the data, it shows "Last Update: 1969/12/31 19:33".

Strange, isn't it?

4
Dave_L
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:20

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


What's the value of mylinks_links.date?

Example: The value 1108795494 is the Unix timestamp for Sat Feb 19 01:44:54 2005 EST.

5
JMorris
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:23

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


It's different for each link, of course, but here's a random sampling of the dates:

2000-11-08 79:12:31
2003
-12-14 00:25:25
2003
-12-14 00:37:40
2003
-12-18 22:59:44
2003
-12-18 23:30:20


The above are directly copy and pasted from phpMyAdmin, date column of mylinks_links.

6
Dave_L
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:25

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


How are you displaying that? Isn't that column type int(10)?

7
JMorris
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:27

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Field = date
Type = datetime
Attributes =
Null = Yes
Default = NULL
Extra =

I just tried changing it to int(10) and nothing changed.

Link:http://cit.wvup.edu/tech/modules/mylinks/

8
Dave_L
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:40

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


This is from modules/mylinks/sql/mysql.sql, XOOPS 2.0.9.2:

#
# Table structure for table `mylinks_links`
#

CREATE TABLE mylinks_links (
  
lid int(11unsigned NOT NULL auto_increment,
  
cid int(5unsigned NOT NULL default '0',
  
title varchar(100NOT NULL default '',
  
url varchar(250NOT NULL default '',
  
logourl varchar(60NOT NULL default '',
  
submitter int(11unsigned NOT NULL default '0',
  
status tinyint(2NOT NULL default '0',
  [
color=ff0000]date int(10NOT NULL default '0',[/color]
  
hits int(11unsigned NOT NULL default '0',
  
rating double(6,4NOT NULL default '0.0000',
  
votes int(11unsigned NOT NULL default '0',
  
comments int(11unsigned NOT NULL default '0',
  
PRIMARY KEY  (lid),
  
KEY cid (cid),
  
KEY status (status),
  
KEY title (title(40))
TYPE=MyISAM;


I don't know why your column is of type datetime. But if the PHP script interprets a value like "2003-12-18 23:30:20" as a Unix timestamp, then I would expect it be displayed like what you're getting.

9
JMorris
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:46

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


I'm migrating data from a php-nuke site to a XOOPS site; therefore, there's a few things that haven't matched up. I changed the type as you suggested, but that did not fix the problem.

BTW... Thanks for all the help!

10
Dave_L
Re: Last Update: 1969/12/31?!
  • 2005/2/19 6:54

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


To convert a datetime column to an int column, I would first change the column to varchar (wide enough to hold the data), then use a query like "UPDATE table SET date = UNIX_TIMESTAMP(date)" to convert the dates to Unix timestamps, then change the column type to int.

Login

Who's Online

224 user(s) are online (137 user(s) are browsing Support Forums)


Members: 0


Guests: 224


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits