Advertisement

date, time and timestamp in MYSQL and Joomla v1.

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
erik2055
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Nov 28, 2006 12:27 am

date, time and timestamp in MYSQL and Joomla v1.

Post by erik2055 » Fri Feb 02, 2007 11:22 am

In the test data \installation\sql\*.sql files, there are default values for check-out times with all zeroes: 0000-00-00 00:00:00.
This is a problem in MySQL, because TIMESTAMPs cannot be earlier than the year 1970.
I started using Eclipse and Quantum DB to write a new component, and stumbled over this issue.

I cite from  http://dev.mysql.com/doc/refman/5.0/en/datetime.html:


Remember that although DATETIME, DATE, and TIMESTAMP  values all can be specified using the same set of formats, the types do not all have the same range of values. For example, TIMESTAMP values cannot be earlier than 1970 or later than 2037. This means that a date such as '1968-01-01', while legal as a DATETIME or DATE  value, is not valid as a TIMESTAMP value and is converted to 0.

Changing all these values in the *.sql files to 1970-01-01 00:00:01  would solve the problem , I think.

Advertisement
User avatar
Jonah
Joomla! Explorer
Joomla! Explorer
Posts: 299
Joined: Thu Aug 18, 2005 6:02 pm
Contact:

Re: date, time and timestamp in MYSQL and Joomla v1.

Post by Jonah » Fri Feb 02, 2007 7:28 pm

You should use the quote tag next time when quoting.

Examine what the table structure of one of the tables.  Note that 0000-00-00 00:00:00 is being inserted into columns of type DATETIME, which, from your own quote is legal.

TIMESTAMPs are seconds since unix epoch and that's why they can't be <1970.
trinitywebhosting.com - Free Joomla! websites for churches and non-profits.

Advertisement

Locked

Return to “General Questions - 1.0.x”