i am new to JQuery.I need to convert the below string into following dateTime format.How to achieve this?  string value:   var w = "/Date(1388514600000)/"   Expected Date format Example:-  "Wed Jan 01 2014 00:00:00 GMT+0530 (India Standard Time)"   I need to achieve above without jQuery DatePicker UI and anyother UI?  Is this possible to achieve my Expected value in given string?  i am tried like this:-   var d=date.parse(w);  console.log(d);   output:-  NaN   Any help or an idea will be more helpful?  Thank you.Please give me a suggestion!  how to achieve above in JQuery?
446
I'm taking my first crack at  with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:  /Date(1224043200000)/   From someone totally new to JSON - How do I format this to a short date format? Should this be handled somewhere in the jQuery code? I've tried the jQuery.UI.datepicker plugin using $.datepicker.formatDate() without any success.  FYI: Here's the solution I came up with using a combination of the answers here:  function getMismatch(id) {   $.getJSON("Main.aspx?Callback=GetMismatch",     { MismatchId: id },      function (result) {       $("#AuthMerchId").text(result.AuthorizationMerchantId);       $("#SttlMerchId").text(result.SettlementMerchantId);       $("#CreateDate").text(formatJSONDate(Date(result.AppendDts)));       $("#ExpireDate").text(formatJSONDate(Date(result.ExpiresDts)));       $("#LastUpdate").text(formatJSONDate(Date(result.LastUpdateDts)));       $("#LastUpdatedBy").text(result.LastUpdateNt);       $("#ProcessIn").text(result.ProcessIn);     }   );    return false; }  function formatJSONDate(jsonDate) {   var newDate = dateFormat(jsonDate, "mm/dd/yyyy");   return newDate; }   This solution got my object from the callback method and displayed the dates on the page properly using the date format library.
40928
How can you check whether a string is convertible to an int?  Let's say we have data like "House", "50", "Dog", "45.99", I want to know whether I should just use the string or use the parsed int value instead.  In JavaScript we had this  function. If the string couldn't be parsed, it would get back NaN.
6955
I'm reading text from a flat file in c# and need to test whether certain values are dates. They could be in either YYYYMMDD format or MM/DD/YY format. What is the simplest way to do this in .Net?
58463
Does anyone know of an easy way to escape HTML from strings in ?  I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks).  I'm sure it's possible to extend jQuery to do this, but I don't know enough about the framework at the moment to accomplish this.
1238
How do I use the jQuery Datepicker with a textbox input:  $("#my_txtbox").datepicker({   // options });   that doesn't allow the user to input random text in the textbox. I want the Datepicker to pop up when the textbox gains focus or the user clicks on it, but I want the textbox to ignore any user input using the keyboard (copy &amp; paste, or any other). I want to fill the textbox exclusively from the Datepicker calendar.  Is this possible?  jQuery 1.2.6 Datepicker 1.5.2
32919
I'm trying to parse an international datetime string similar to:  24-okt-08 21:09:06 CEST   So far I've got something like:  CultureInfo culture = CultureInfo.CreateSpecificCulture("nl-BE"); DateTime dt = DateTime.ParseExact("24-okt-08 21:09:06 CEST",     "dd-MMM-yy HH:mm:ss ...", culture);   The problem is what should I use for the '...' in the format string? Looking at the  MSDN page doesn't seem to list a format string for parsing timezones in PST/CEST/GMT/UTC form.
35212
How do I convert a datetime string in local time to a string in UTC time?  I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.  Clarification:  For example, if I have 2008-09-17 14:02:00 in my local timezone (+10), I'd like to generate a string with the equivalent UTC time: 2008-09-17 04:02:00.  Also, from , note that in general this isn't possible as with DST and other issues there is no unique conversion from local time to UTC time.
52641
I'm trying to change date format of this component but I dont find any attribute (like ui:inputDate has) to change the date format.   &lt;lightning:input type="date" name="input8" label="Dates" value="2017-09-07" min="2017-09-05" max="2017-09-22" /&gt;   NOTE:Also I have used the new &lt;lightning:inputField fieldName="date__c" /&gt; for dates and actually works really nice but date format is a must I need to change.  This is an example of official lightning input here:     The first one is Lightning input, the second one is ui:inputDate component.  I'm guessing it is changed by your Time Zone but actually, there is no change at all.   Any ideas about how can I use it with the date format I want (DD/MM/YYYY)? Thanks
10781
How can I specify a custom date formate to be validated with the  for jQuery?
13722
I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider for .NET).  My basic requirement is a thousand separator format for numbers for now, but something that handles lots of combinations (including dates) would be good.  I realize Microsoft's  library provides a version of String.Format(), but we don't want the entire overhead of that framework.
122501
The following code returns the time of the current date:  System.debug('Current date: ' + Date.today().toStartOfMonth());   Output:     2018-08-01 00:00:00   How to remove time from date?
9505
Let me explain you the problem   $ date +%c -d "$d" Tue 31 Dec 2013 01:13:06 PM CET $ date +'Today is %F' -d "$d" Today is 2013-12-31   This solution corresponds to current date.  But I have one variable which stores date other than current date  $Prev_date="Wed Dec 25 06:35:02 EST 2013"    I am looking for solution to read this date as 2013-12-25 and store it in a variable.  I have tried this:  a=`date --date=$Prev_date '+%y/%m/d'` echo $a   It's giving this error:  date: illegal option -- date=Wed usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff]
41596
I'm officially breaking up with Salesforce Date parsing. This has got to be the most frustrating thing.  I have the following date in a JSON string (full JSON below):     2017-06-03T10:34:24.000Z   But when I try to deserialize the data:  Opportunity[] results = (List&lt;Opportunity&gt;)JSON.deserialize(res, List&lt;Opportunity&gt;.class);   I get the following error:     System.JSONException: Cannot deserialize instance of date from VALUE_STRING value 2016-12-05T16:19:44.000Z   I have looked at so many date parse issues before and from what I've gathered  it must be in ISO 8601 - though ISO 8601 can take various shapes:   All of the following seem to recommend exactly what I've done          How should I format this date string?  Thank you!  Full JSON string:  [{   "name":"OpportunityABC",   "CloseDate":"2017-06-03T10:34:24.000Z",   "StageName":"Pre-Engagement",   "Amount":"4810308.0", }]
8889
Is there a way to format a UTC time into any arbitrary string format I want in java?  Basically I was thinking of having some class take the timestamp and I pass it is string telling it how I want it formated, and it returns the formatted string for me.  Is there a way to do this?
11883
How can I format a date as dd/mm/yyyy or mm/dd/yy ?   Like in VB format("dd/mm/yy",now)  How can I do this in C#?
101677
I'd really like a user option to show all dates as yyyy-mm-dd HH:mm after the 2 day mark. I find the existing non-standard semi-verbose American Mon DD 'YY style date to be ugly and difficult to parse.  I am not asking for anything complicated here, just a simple user option to show the date and time in the international ISO 8601 format across the board. Since it's already in the tooltip everywhere, it should be a simple change to optionally show it in the page body for those users who want it.  Secondarily, if it's not too difficult, I'd very preferably like to see date &amp; times in my local time, rather than the UTC time as is currently shown used. It seems to make much more sense to me for see a question "asked 2014-02-04 10:19" as being my local time - I don't know what UTC is without using a converter (in this the before-2-days "asked 6 hours ago" is quite good).  (Re-raising this feature-request at the explicit behest of moderator Anna Lear; please don't close as a duplicate).
36947
Apparently if I want to format a date to my own format ie. 1 June 2016 10:44 am I can only do this with outputText but output text does not respect the users time zone so everything is GMT. If I use outputField it automatically converts it to the users time zone but I have no control over the format it displays it in. Does someone know how to get my custom format to display in the users time zone? I don't care which I use I just want to show it my way in the proper time zone  This respects users time zone but I cannot control formatting  &lt;apex:outputField value="{!c.CreatedDate}"/&gt;   or This does not respect users time zone but I can control formatting   &lt;apex:outputText value="{0,date,dd MMM YYYY h:mm a}"&gt;   &lt;apex:param value="{c.CreatedDate}"/&gt; &lt;/apex:outputText&gt;   This method is called from the controller when page is called and populates the variable csComments with records  public void ShowComments() {   disp = true;   RetrieveAcctInfo();   caseNo = System.currentPagereference().getParameters().get('cn');   System.debug('Case No: ' + caseNo);   cd = [select id, AccountId, Priority from Case where CaseNumber=:caseNo];   if (acctid != cd.AccountId) { disp = false; errMsg = 'Access Restricted'; }    else {     csComments = [select Comment__c, CreatedDate from CSPComments__c where CaseCom__c=:cd.id ORDER BY CreatedDate DESC];     ccCount = csComments.size();   }   initpri = new List&lt;SelectOption&gt;();     initpri.add(new SelectOption('None',' -- Select Priority --', true));   initpri.add(new SelectOption('Level 1','1 - System Down'));   initpri.add(new SelectOption('Level 2','2 - Funtioning with Errors'));   initpri.add(new SelectOption('Level 3','3 - System Issue'));   initpri.add(new SelectOption('Level 4','4 - Non Critical Issue'));   inpri = cd.Priority;   curpri = inpri; }   This is the part of the page that is showing the results. The manager wants my date to be in the approved style of 1 June 2016 11:26 am    &lt;apex:pageBlock id="cl" rendered="{!disp}"&gt;    &lt;!-- Retrieved {!ccCount} comments&lt;br /&gt;  --&gt;     &lt;table&gt;&lt;tr&gt;&lt;th&gt;Date/Time&lt;/th&gt;&lt;th&gt;Comment&lt;/th&gt;&lt;/tr&gt;       &lt;apex:repeat value="{!csComments}" var="c"&gt;         &lt;tr style="padding:4px 0px 4px 0px"&gt;           &lt;td padding-right="4px"&gt;             &lt;!-- &lt;apex:outputText value="{0,date,d MMM YYYY h:mm a}"&gt;&lt;apex:param value="{!c.CreatedDate}"/&gt;&lt;/apex:outputText&gt;  --&gt;               &lt;apex:outputField value="{!c.CreatedDate}" /&gt;             &lt;/td&gt;           &lt;td&gt;&lt;textarea class="dtarea" rows="4" cols="60" disabled="true"&gt;{!c.Comment__c}&lt;/textarea&gt;&lt;/td&gt;         &lt;/tr&gt;     &lt;/apex:repeat&gt;     &lt;/table&gt;     &lt;/apex:pageBlock&gt;