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

  • Home
  • SEARCH
  • 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 7804039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:47:03+00:00 2026-06-02T01:47:03+00:00

I keep looking for steps in the Internet on how I can change a

  • 0

I keep looking for steps in the Internet on how I can change a format of a certain date

$j("#activitycalendar").datepicker("setDate", $j.datepicker.parseDate("yy-mm-dd",$_GET.critval)); 

All I want to do is to set the date of a datepicker depending on what the $_GET.critval contains. And the $_GET.critval contains a date in this format

2011-12-05

as the jqueryui documents says

“The new date may be a Date object or a string in the current date
format (e.g. ’01/26/2009′)” jQuery UI – Datepicker Demos and Documentation

so I wanted to change the format of my $_GET.critval so it can change the date of the datepicker. I tried the $j.datepicker.parseDate but it really doesn’t work. the return value of that parsing will be like this

Mon Dec 05 2011 00:00:00 GMT+0800 (Taipei Standard Time)

Is there any solution so I can format the date and set the date of the datepicker? thanks

  • 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-06-02T01:47:05+00:00Added an answer on June 2, 2026 at 1:47 am

    Check out moment.js! It’s a really powerful little library for working with Dates in JavaScript.

    var today = moment(new Date());
    today.format("YYYY-M-D");                  // "2012-4-11"
    today.format("MMMM D, YYYY h:m A");        // outputs "April 11, 2012 2:40 PM"
    
    // in one line...
    moment().format("YYYY-M-D");               // "2012-4-11"
    moment().format("MMMM D, YYYY h:m A");     // outputs "April 11, 2012 2:40 PM"
    

    Another example…

    var a = moment([2012, 2, 12, 15, 25, 50, 125]);
    a.format("dddd, MMMM Do YYYY, h:mm:ss a"); // "Monday, March 12th 2012, 3:25:50 pm"
    a.format("ddd, hA");                       // "Mon, 3PM"
    

    Also, its worth mentioning to checkout date.js. I think the two libraries complement each other.

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

Sidebar

Related Questions

I'd like to use model binding to keep my controllers looking cleaner, you can
I'm looking for a way that I can keep a database in one single
I am looking to keep track of people in my iPhone app - either
I'm looking for a tool that keep GAC synchronized across different systems. when a
I'm looking for a way to keep the equivalent of persistent global variables in
I'm looking for a data structure (or structures) that would allow me keep me
Is there a way to keep a window inactive looking, even if it contains
I am looking to recode a large number of variables, and figure I can
Was looking to get peoples thoughts on keeping a Lucene index up to date
I'm looking for a way to efficiently serialize Clojure objects into a binary format

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.