Hi!
i receive date from GUI to Jquery file.
in one textbox contain date from datepicker .
Now my problem is hoe to convert string to Datetime format in jquery.
please send only correct format.
i am trying to so many options but no use.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lucky Laxman92 reputationPosted Jun 23, 2015, 3:07 AM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted Jun 23, 2015, 6:11 AM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Jun 23, 2015, 6:37 AM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jun 23, 2015, 6:59 AM EDT
var sd = $("#startDatePicker").datepicker('getDate'); var sDate = $.datepicker.formatDate('dd-MM-yy', sd); Other Way : var sd = $("#startDatePicker").datepicker('getDate');sd);//Outputs it in the format of your choice
string formattedDateTime = sd.ToString("dd/MM/yyyy");Jaipal ReddyRank #588 · 4.1K reputationPosted Jun 23, 2015, 10:07 PM EDT
from = $("#datepicker").val().split("-"); f = new Date(from[2], from[1] - 1, from[0]);Jaipal ReddyRank #588 · 4.1K reputationPosted Jun 23, 2015, 10:08 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 23, 2015, 11:18 PM EDT
var from = $("#datepicker").val().split("-"); var ff = new Date(from[2], from[1] - 1, from[0]);Gohil JayendrasinhRank #490 · 5K reputationPosted Jun 27, 2015, 2:13 AM EDT
Veerendra , I think you have language issue.
The date picker is designed to allow localizations to be easily created and used. Many localizations are already available, and additional ones are welcomed.
The date picker plugin maintains a manager object, $.datepicker, that lets you register new localizations. This object maintains an array of localization settings indexed by language, with '' accessing the default (English) version: $.datepicker.regional['fr'].
A new localization should be created in a separate JavaScript file named ui.datepicker-.js. Within a document.ready event it should add a new entry into the $.datepicker.regional array, indexed by the language code.
$('selector').datepicker($.datepicker.regional['' ]);
Like
// ui.datepicker-fr.js is in franch you can attached from following folder development-bundle/ui/bundle/i18n
$(function() {
$.datepicker.setDefaults($.datepicker.regional['fr']);
$("#StartDate").datepicker();
});