Results 1 to 3 of 3
  1. #1
    ABW Ambassador parentsworld's Avatar
    Join Date
    January 17th, 2005
    Calgary, Alberta, Canada
    After much head banging over a simple error (thanks, Tom [img]/infopop/emoticons/icon_smile.gif[/img] ) I got what should have been a really simple guestbook script working at our Scout Troup's website.

    BUT, upon looking at the entries (after messing up and overwriting a few -- it's been a looong day!) the date contains a two year old problem.

    The date shows up as follows: Tuesday, October 1, 19102 at 01:06:19 I found the line of code for the date. It is: 19$year So it's obvious that the "19" has to go but what's the right way to do this?

    Change it to 20 then minus 100? (if you don't minus 100 adding the 20 would give you 20102)

    How would you go about doing this? Is it as simple as something like 20$year(-100) or am I barking up the wrong tree with this line of thought?

    'Veni, Vidi, Velcro' - I came, I saw, I stuck around

  2. #2
    Join Date
    January 17th, 2005
    <disclaimer> I don't know php but I've just begun to have a need for it... </disclaimer>
    From what I can tell it is outputing "19" and then the variable "$year" which you designed to be only the last two digits of the current year. But now that number has increased to 3 digits and so it's broken... Uh oh, I just lost my motivation to explain everything that's going on! So the real way to fix it would be to make $year hold all of the digits for the current year so you'd have to store 2002 into it and then change the script to only write $year (without the 19 in front). In case you can't change $year (since I don't actually know php yet it could be a built-in variable...), the cheap-hack way would be to do what you came up with but it would probably cause all the 1900 dates to become 2000's.

  3. #3
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    yer working a math problem with strings - not good, lol

    before you output the string, do a little math first:
    <pre class="ip-ubbcode-code-pre">
    $4dyear = 1900 + $year;
    print $4dyear;
    Or, even better, alter your guestbook script to use unix time offsets (the count of the number of seconds which have elapsed since 00:00, 1 Jan 1970) formatted with php's date() function...

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. SAS Datafeed Question: LastUpdated Date Validity?
    By markwelch in forum ShareASale - SAS
    Replies: 2
    Last Post: February 14th, 2007, 08:34 PM
  2. tracking question
    By ~Michelle in forum Midnight Cafe'
    Replies: 0
    Last Post: August 21st, 2006, 09:50 AM
  3. date modified question
    By steveyoung in forum WebMerge (
    Replies: 2
    Last Post: May 1st, 2006, 01:02 PM
  4. Expiration Date Question
    By DHolland in forum Midnight Cafe'
    Replies: 2
    Last Post: October 4th, 2005, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts