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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:03:33+00:00 2026-06-04T20:03:33+00:00

tableHTML += <td class=\stamp\>+jsonObject[i][‘stamp’]+</td>; this is currently displaying 2012-05-25 23:08:57 how can i change

  • 0
    tableHTML += "<td class=\"stamp\">"+jsonObject[i]['stamp']+"</td>";

this is currently displaying 2012-05-25 23:08:57how can i change this to a May 25,2012

a commentor noted that it may be better to do this with php, the only time i could do it with php is before entering it to the array. is this possible?

$videos_array = array();
while ($i < $num) {
$current_video = array (
'stamp'=>mysql_result($result,$i,"stamp"));
array_push($videos_array, $current_video);
        $i++;
    }
    echo json_encode($videos_array);
  • 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-04T20:03:34+00:00Added an answer on June 4, 2026 at 8:03 pm

    Use a real date library as Dr.Dredel suggests, but if you want an awful hack, there is always

    new Date(Date.parse("2012-05-25 23:08:57")).toDateString().substring(4)
    

    Not to be used in serious code. It relies on the output of toDateString which is locale dependent. The proper way to do this is to take a date object and just before you are to display it, choose a date format.

    The built-in date object in JavaScript does not do a good job of this.

    You can find examples of its use in the MDN documentation.

    ADDENDUM

    Okay, I’ve gotten serious and produced an example using datejs. You can find a live working version here.

    Basically, put the following in your HTML:

    <script src="http://cachedcommons.org/cache/datejs/1.0.0/javascripts/date-min.js"></script>
    

    ​
    Then in your JavaScript adapt the following code:

    var d = Date.parse("2012-05-25 23:08:57");
    alert(d.toString("MMM dd, yyyy"));
    

    ​

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

Sidebar

Related Questions

I have a collection of rows, I can generate Table(HTML) out of it using
I have a table like this: | X | Y | Data | ----------------
I have a comma-separated value file that looks like this when I open it
I am using the difflib.HtmlDiff class, calling the function using two sets of text
BA.Table.prototype.drawHeader = function() { if ( ! this.headHTML ) { this.headHTML = $('<thead/>'); var
I have a class that I want to use in many test cases: require
I'm sure I've seen this before and know the answer to it but after
Can anyone think of a way to approach converting the following scheme into a
I've got this issue. A template called checkbox that's called from while inside a
I can set up parsing, and connect to a site but, when I run

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.