reply

Using the java script
the input is jan/23/1999(mm/dd/yyyy) in this format then how we get the out put as follows1/23/03(mm/dd/yy).The year is displayed only two digits.How to write this using date function.please mail the program.

Comments

  • Few things first:

    1. Improve your grammar. It's easier to read, and it won't make me thing of you as a script kiddie.
    2. I'm not going to mail you anything. Come back and check, or do without.

    That said:

    The getFullYear method returns a four-digit year, the getYear method returns it two-digit. You could also have truncated the four-digit one to get the two-digit one.

    As for the months, I can only remember the getMonth method. I think that returns the number, but I can't be sure without testing.

  • getYear() returns last two digits of the year.
    getFullYear() returns all four digits of the year.

    getMonth() returns an integer between 0 - 11 where 0 is January and so on.

    Unlike Visual Basic, you cannot get literal month values in Javascript. You have to use an array then replace the integers (0 - 11) you get from getMonth with your literals.

    Search for this: javascript date functions for examples.

    : Using the java script
    : the input is jan/23/1999(mm/dd/yyyy) in this format then how we get the out put as follows1/23/03(mm/dd/yy).The year is displayed only two digits.How to write this using date function.please mail the program.
    :

    [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories