Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • All date formats in Javascripts

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 116
    Comment on it

    Hello Reader's If your website getting the dates in different different date formats. Then you can see all the date formats that are valid in JS. Let's see the below date formats in JS.

    var d = new Date("2015-03-25");
    var d = new Date("2015-03");
    var d = new Date("2015");
    var d = new Date("2015-03-25T12:00:00");
    var d = new Date("Mar 25 2015");
    var d = new Date("25 Mar 2015");
    var d = new Date("Jan 25 2015");
    var d = new Date("2015, JANUARY, 25");
    var d = new Date("03/25/2015");
    var d = new Date("03-25-2015");
    var d = new Date("2015/03/25");
    var d = new Date("Fri Mar 25 2015 09:56:24 GMT+0100 (Tokyo Time)");
    var d = new Date("Wed Mar 25 2015 09:56:24 GMT+0100 (W. Europe Standard Time)");
    

    So all the date formats above are correct and you can use them in order to sort or compare with another date. Even you can convert them into Unix time easily.

 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: