Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Type column range!? pls Help

Status
Not open for further replies.

Forri

Programmer
Oct 29, 2003
479
MT
Hi

I'm using a date type column for Date of Birth. The problem is that it seems that the Year range starts 1970!! is it true? How can i fix this problem?

Thanks
Nick
 
What do you mean "the year range starts 1970"? This sounds like it might be a PHP situation. Please provide more detail.

*cLFlaVA
----------------------------
Ham and Eggs walks into a bar and asks, "Can I have a beer please?"
The bartender replies, "I'm sorry, we don't serve breakfast.
 
yep i've noticed thanks and soryr for disturbing!

Nick
 
I think you are running on windows, correct? Windows has a fit if the date is before Jan 1, 1970.

Bastien

Cat, the other other white meat
 
no the server is Linux! i'm running ie on Windows but that shouldn't afect it?!! or!

I'll need to check into it!

Thanks
Nick
 
Forri:
Which specific date/time columntype are you using?

According to the MySQL online manual, the limits of the various date/time types are:[ul][li]DATE[/li][ul][li]1000-01-01 through 9999-12-32[/li][/ul][li]DATETIME[/li][ul][li]1000-01-01 00:00:00 through 9999-12-31 23:59:59[/li][/ul][li]TIMESTAMP[/li][ul][li]1970-01-01 00:00:00 to partway through the year 2037[/li][/ul][/ul]

And the manual does not specify any OS-specific limits beyond that.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I'm using Date as columnType! but as clFlava stated its not a mySql problem but a PHP problem...have no idea why its doing so!

Thanks anyways guys...i solved it by changing the type to string (since it only stores the Date of Birth...no use with date type)


Thanks again
Nick
 

Depending on what PHP functions you are using, the problem could have resulted there.

There was really no need to convert the column to type char, but, rather, use a different function.

For example, the function mktime(), I believe, only works with dates after 1/1/1970. There are definitely ways around this.

*cLFlaVA
----------------------------
Ham and Eggs walks into a bar and asks, "Can I have a beer please?"
The bartender replies, "I'm sorry, we don't serve breakfast.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top