0

I want to get local machine datetime format in Jquery? means if local date time format is in "MM-dd-yyyy" ,so this format I want to get in jquery. OR How can I convert my any datetime in local datetime format in jquery?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Shivkumar
  • 1,903
  • 5
  • 21
  • 32
  • Please post your code??? – Hariharan Jul 12 '13 at 06:38
  • 1
    jquery does not deal with date time formats, for that you can look at date time libraries like [momentjs](http://momentjs.com/) – Arun P Johny Jul 12 '13 at 06:38
  • Did you try google it? Be sure you're not the first guy encounter with this problem. – gdoron Jul 12 '13 at 06:38
  • possible duplicate of [How do I display a date/time in the user's locale format and time offset?](http://stackoverflow.com/questions/85116/how-do-i-display-a-date-time-in-the-users-locale-format-and-time-offset) – Arun P Johny Jul 12 '13 at 06:39
  • @Arun actually i have one service which convert date according to dateformat which we have pass, so i want to get local datetime format so that i show date according to local date time format. – Shivkumar Jul 12 '13 at 06:47

1 Answers1

1

You can change date format in jquery datepicker as such:

var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' }).val();

This Link , Link and Link may be helpful.

Community
  • 1
  • 1
Sakthivel
  • 1,890
  • 2
  • 21
  • 47