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? 

Jun 10, 2022 in JQuery by gaurav
• 23,260 points
633 views

1 answer to this question.

0 votes

“jquery datepicker format” Code Answer's

  1. $('#timePicker'). datetimepicker({
  2. // dateFormat: 'dd-mm-yy',
  3. format:'DD/MM/YYYY HH:mm:ss',
  4. minDate: getFormattedDate(new Date())
  5. });
  6. function getFormattedDate(date) {
  7. var day = date. getDate();
answered Jun 10, 2022 by rajatha
• 7,680 points

Related Questions In JQuery

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,244 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,371 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,546 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
718 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
20,345 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,309 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,520 points
1,349 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,840 points
15,878 views
0 votes
1 answer

How do I format date in jQuery datetimepicker?

d - Day of the month. ddd - ...READ MORE

answered Jun 28, 2022 in JQuery by rajatha
• 7,680 points
940 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
678 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