Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Javascript The setFullYear() Method

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 136
    Comment on it

    In Javascript , setFullYear ( ) method set the full year for a for a given date based on local time . It return a new timestamp .
    Syntax ->

    setFullYear( yearValue , monthValue , dayValue ) <br>
    

    Parameter -> yearValue -> It specify the numeric value of the year , like 2014 .
    monthValue -> It return integer between 0 and 11 (i.e january through december ) .It is optional .
    dayValue -> It return integer between 1 and 31 ( i.e day of the month ) . It is also optional .
    Note -> If you write the value of dayValue then you must also specify the monthValue .(Both are optional )
    Return value -> It return the new timestamp value for the current object .
    If you do not specify the monthValue and dayValue parameter , then their values returned from the getMonth() and getDate() methods .
    Example ->

    var date = new Date ();<br>
    date.setFullYear( 2000);<br>
    

    Another Example ->

    date = new Date ("september 17 ,1992 5.30 ") ;
    document.write ("Before using setfullyear method :" "+ date + "); // September 12 1992 5.30
    newdate = date.date.setFullYear(2014);
    document.write ("After using setfullyear method :" "+ date + "); // september 17 2014 5.30 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: