Different year displayed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thesti
    New Member
    • Nov 2007
    • 144

    Different year displayed

    hi,

    in my web i use javascript to show the current date. to the user.

    the problem is on the year. i use the function:

    var today = new Date();
    year = today.getDate() ;

    but then the output that i get is different in opera and in IE 6.
    in IE 6 the output is 2008
    while in firefox and opear it's 108

    how to solve this problem?

    thanks in advance
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The proper method to use is getFullYear(). getYear() is deprecated.

    Comment

    • thesti
      New Member
      • Nov 2007
      • 144

      #3
      Originally posted by acoder
      The proper method to use is getFullYear(). getYear() is deprecated.

      thx for the help acoder.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You're welcome :)

        Comment

        Working...