I am developing Phonegap application. In that i have date field for that i have to change DateFormat from (2015-03-16 to 16-Mar-2015). So please tell me how to solve this one.I am using Jquerymobile
            Asked
            
        
        
            Active
            
        
            Viewed 803 times
        
    -2
            
            
        - 
                    Do you mean in JavaScript? What have you tried? Some code would be helpful too – Alvaro Montoro Mar 16 '15 at 12:14
- 
                    possible duplicate of [how to format javascript date](http://stackoverflow.com/questions/3552461/how-to-format-javascript-date) – AtanuCSE Mar 16 '15 at 15:27
1 Answers
0
            
            
        Try this
<script type="text/javascript">
<!--
var m_names = new Array("Jan", "Feb", "Mar", 
"Apr", "May", "Jun", "Jul", "Aug", "Sept", 
"Oct", "Nov", "Dec");
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
document.write(curr_date + "-" + m_names[curr_month] 
+ "-" + curr_year);
//-->
</script>
 
    
    
        Nurdin
        
- 23,382
- 43
- 130
- 308
- 
                    Hi all.I am using jquerymobile date field on selecting Date from datepicker i need to change the date format as above. – nagagani Mar 17 '15 at 05:54
- 
                    
