Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6076009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:33:32+00:00 2026-05-23T10:33:32+00:00

I know there are loads of questions on here about changing the datepicker dateFormat,

  • 0

I know there are loads of questions on here about changing the datepicker dateFormat, but i’m following the instructions exactly and they seem to have no effect. Here is the exact code that was suggested on other answers:

$(document).ready(function() {
    $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' });
});

Yet when I run it, and test the datepicker value with alert($('#datepicker').datepicker("getDate"));

I get the date back in the undesired format! This is extremely confusing. Am I something wrong? See the described behaviour at http://jsfiddle.net/TmdM8/

edit: even more confusing is that if I read the dateformat using alert($("#datepicker").datepicker('option', 'dateFormat'));

… the returned dateFormat is correct, even though calling getDate does not return the date in the desired format. See http://jsfiddle.net/fWmBe/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:33:33+00:00Added an answer on May 23, 2026 at 10:33 am

    the date format setting is for what the format looks like when it’s show in the text box the picker is applied to.

    have a look at my updated version of your fiddle:

    http://jsfiddle.net/TmdM8/1/

    as you can see, when you pcick in the text box, and pick a date, it is in the format you have specified.
    as far as i know, the getDate function returns a javascript date.

    EDIT:
    if you wanted to format the output from the javascript date, you’ll need to use a custom script, or a library like date.js (i’ve had great success with this).

    http://code.google.com/p/datejs/

    with that you could do something like :

    $('#datepicker').datepicker("getDate").toString('dd-MM-yyyy');
    

    to get your date in the format you like

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there are many questions about jQuery slideToggle flickering but I haven't seen
I know this questions has been asked a few times here. But these seem
I know there is a very similar question here but I was hoping to
I know there is a lot of controversy (maybe not controversy, but arguments at
I know there is ongoing work for in this regards but what is the
I know there is a lot of talk about BPM these days and I
I know there is a StringIO stream in Python, but is there such a
Are there any criteria one should know / think about before deciding to go
Alright, I know questions like this have probably been asked dozens of times, but
I know this question has been asked 100x but I can't seem to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.