Was working on a date comparison where in my date shouldn't be greater than today's date. I know the way is to wrap both in new Date() and then compare < or >. But having some trouble because my format is dd/mm/yyyy and any date created with new Date() is mm/dd/yyyy. Just want to know if there is any way to pass format to Date object constructor.
            Asked
            
        
        
            Active
            
        
            Viewed 24 times
        
    0
            
            
         
    
    
        Pawan
        
- 605
- 1
- 6
- 18
- 
                    1[This question](http://stackoverflow.com/questions/12409299/how-to-get-current-formatted-date-dd-mm-yyyy-in-javascript-and-append-it-to-an-i) might already have your answer. – Peut22 Aug 05 '15 at 07:50
- 
                    @Peut22 I know we can split and then re-arrange but it would have been nice if we would pass the format while creating date object itself – Pawan Aug 05 '15 at 07:54
- 
                    @Pawan try moment.js you can do this moment("25-12-1995", "DD-MM-YYYY"); – ykay says Reinstate Monica Aug 05 '15 at 07:58