How do I format date in jQuery datetimepicker

0 votes

I use jQuery datetimepicker which was extended from jQuery datepicker to pick not only date but time too.

I want to set date/time format this way: dd-mm-yyyy @ hh:mm

$('#timePicker').datetimepicker({
  dateFormat: 'dd:mm:yyyy',
  separator: ' @ ',
  minDate: new Date()
});

But this does not work. I get date/time in following format:

Thu Jan 27 2011 02:05:17 GMT+0100

Is there any javascript function to format this date/time? If not how do I do that using the plugin? Check out my code: FIDDLE

javascript jquery jquery-ui-datepicker

Jun 9, 2022 in JQuery by Anchal
• 320 points
926 views

1 answer to this question.

0 votes
  1. d - Day of the month.
  2. ddd - Short name of day of the week.
  3. dddd - Full name of day of the week.
  4. M – The month, from 1 through 12.
  5. MMM- Short name of Month.
  6. MMMM- Long name of the Month.
  7. yy - Last two digit if year.
  8. yyyy - Full Year.
answered Jun 28, 2022 by rajatha
• 7,680 points

Related Questions In JQuery

0 votes
1 answer

How do I format date in jQuery datetimepicker?

jquery datepicker format” Code Answer's $('#timePicker'). datetimepicker({ // dateFormat: ...READ MORE

answered Jun 3, 2022 in JQuery by Edureka
• 13,690 points
20,251 views
0 votes
1 answer

How do I format date in jQuery datetimepicker?

jquery datepicker format” Code Answer's $('#timePicker'). datetimepicker({ // dateFormat: ...READ MORE

answered Jun 3, 2022 in JQuery by Edureka
• 13,690 points
1,270 views
0 votes
1 answer

How do I pre-populate a jQuery Datepicker textbox with today's date?

Hello @kartik, You must FIRST call datepicker() > then use ...READ MORE

answered May 29, 2020 in JQuery by Niroj
• 82,840 points
12,201 views
0 votes
1 answer

How do I check if the mouse is over an element in jQuery?

Hello @kartik, Use this code: $("someelement").mouseenter(function(){ ...READ MORE

answered Oct 5, 2020 in JQuery by Niroj
• 82,840 points
2,349 views
0 votes
1 answer

How do I check if file exists in jQuery or pure JavaScript?

Hello @kartik, With jQuery: $.ajax({ url:'http://www.example.com/somefile.ext', ...READ MORE

answered Oct 5, 2020 in JQuery by Niroj
• 82,840 points
6,481 views
0 votes
0 answers

how do I create an array in jquery?

$(document).ready(function() { $("a").click(function() { ...READ MORE

Jun 6, 2022 in JQuery by Edureka
• 13,690 points
683 views
0 votes
1 answer

How can I select an element with multiple classes in jQuery?

Hello @kartik, If you want to match only ...READ MORE

answered Sep 10, 2020 in JQuery by Niroj
• 82,840 points
3,445 views
0 votes
1 answer

How do I iterate through children elements of a div using jQuery?

Hello @kartik, Use children() and each(), you can optionally pass a ...READ MORE

answered Oct 5, 2020 in JQuery by Niroj
• 82,840 points
5,516 views
0 votes
1 answer

How do I format date in jQuery datetimepicker?

“jquery datepicker format” Code Answer's $('#timePicker'). datetimepicker({ // dateFormat: ...READ MORE

answered Jun 10, 2022 in JQuery by rajatha
• 7,680 points
620 views
0 votes
1 answer

How do I implement JQuery.noConflict() ?

You can of course still use jQuery, ...READ MORE

answered Jun 16, 2022 in JQuery by rajatha
• 7,680 points
652 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP