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 457511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:34:43+00:00 2026-05-12T22:34:43+00:00

I have the following JSON date returned from a MVC page e.g. DateProcessed:\/Date(1258125238090)\/ and

  • 0

I have the following JSON date returned from a MVC page e.g.

"DateProcessed":"\/Date(1258125238090)\/"

and I am using JTemplates to process the data as below.

$('#result').setTemplate($("#TemplateResultsTable").html());
$("#result").processTemplate(data);

This is my results template

<script type="text/html" id="TemplateResultsTable">    
<h3>{$T[0].StatusName} - Found: {$T.length} </h3>
<table>
    <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Date Processed</th>
    </tr>
    {#foreach $T as match}
        <tr>
            <td>{$T.match.Title}</td>
            <td>{$T.match.Description}</td>
            <td>{$T.match.DateProcessed}</td>
        </tr>
    {#/for}
</table>
</script>

All works great apart from the fact that my date is outputted on the page as /Date(1258125238090)/

How do I format the date inside my results template?

  • 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-12T22:34:43+00:00Added an answer on May 12, 2026 at 10:34 pm

    Answer below in case anybody else searches this post…

    Add the following JScript….

    function formatJSONDate(jsonDate) {
        var date = eval(jsonDate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));
        return dateFormat(date, "ddd ddS mmm yyyy");
     }  
    

    download a javascript date format library then in your jTemplate template add

    <td>{formatJSONDate($T.match.DateProcessed)}</td>
    

    And that’s that!

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

Sidebar

Related Questions

I have the following JSON returned from an AJAX call: {rows:[{Date:07/10/2011,Value:1206,Action:Drink}, {Date:07/11/2011,Value:2288,Action:Pie}, {Date:07/12/2011,Value:1070,Action:Drink}, {Date:07/13/2011,Value:1535,Action:Beer},
I have date data being returned from a server in the following format through
I have the following JSON data being returned, but for some reason, Javascript or
I have the following json returned to me from an API. sections: { 1:
I have the following JSON data: ( 3, { body = 123; date =
A] Problem summary: I have JSON data being returned from python to javascript. I
I have the following JSON data being returned by a webservice: {d:[ {RelationshipManager:{},AdvisoryId:13,ClientId:22,UserId:13,AdvisoryMessage:Welcome!,Seen:false,Issued:\/Date(1312123970110)\/,Delivered:null,Importance:3}, {RelationshipManager:{},AdvisoryId:14,ClientId:22,UserId:13,AdvisoryMessage:A
Possible Duplicate: How to format a JSON date? I have the following result from
I have the following JSON coming back from a web service which I am
I am getting the following result from converting xml to JSON, using more than

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.