FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Bday code incapable of recording dates before 1969
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Bday code incapable of recording dates before 1969 [message #3034 is a reply to message #3032] Fri, 07 June 2002 21:28 Go to previous messageGo to previous message
tgaastra is currently offline  tgaastra   United States
Messages: 90
Registered: June 2002
Karma:
Member
Are you sure? Have you gone back and looked?

I can put the number as (for instance) March 15 1955, but when I read the profile in again its March 15 1969.

Checking an actual query of the entry in fud2_users comes back with bday being 19690315.

Without digging too much into things, if I had to hazard a guess, I'd say its the fmt_year function in register.php.

It uses mktime passed into date to return a formated year, but mktime returns a timestamp, which is incapable (at least under RedHat 7.3 Linux) of representing a date earlier than the epoch.

Take this little snippet of php:
<html>
<head><title>Foo</title></head>
<body>
<?php
print(date("Y", mktime(1,1,1,1,1,1955)));
?>
</body>
</html>

On my system, this prints 1969.

Probably what needs to happen is that fmt_year is going to have to do a little guess work on its own rather than rely on mktime.

If people just use two digits, assume that just like the YEAR format does in SQL that its between 1970 and 2069.

Of course, if you used the DATE format, it would do that for you. Smile



[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Login problem using IE in FUD 1.2.4
Next Topic: Typo in moderator options FUD 2.0 RC6
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 07:37:13 GMT 2024

Total time taken to generate the page: 0.03114 seconds