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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:34:20+00:00 2026-06-12T00:34:20+00:00

Currently I need to output a date in a: ‘5 October, 2012’ type format.

  • 0

Currently I need to output a date in a: ‘5 October, 2012’ type format. Meaning day-of-month with no leading zeros, space, full month name, comma, space, four-digit year. I need to do this in JavaScript. I have this working but it occurs to me while writing the lengthy code that somebody must’ve already figured out a better way to do this.

I don’t think there is a built in function of JavaScript that formats this exactly how I want. There is just a thing in PHP with date(). Is there a plugin for JavaScript that does the same thing?

For the sake of giving a specific example, in this instance I start with a set number of hours into the future that I need to get the date for.

Currently I have:

    var myNow = new Date().getTime();
    var myTime = hours * 60 * 60 * 1000;
    var myDate = new Date(myTime + myNow);
    var myDay = myDate.getDate();
    var myMonthNum = myDate.getMonth();
    var myMonth = '';
    var myYear = myDate.getFullYear();

    switch(myMonthNum) {
        case 0:
            myMonth = 'January';
            break;
        ...

    var completeDate = myDate = " " + myMonth + ", " + myYear;
    $('#theEndDate').html(completeDate);
  • 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-12T00:34:22+00:00Added an answer on June 12, 2026 at 12:34 am

    No, there is nothing built-in for Dateobjects, but there are a bunch of libraries to deal with and format them:

    • date.js
    • moment.js
    • XDate
    • Date and Date.Extras in Mootools
    • Date in Sugar
    • Dojo.date
    • a few functions in Mochikit
    • DateFormat (only PHP’s date)
    • date at php.js
    • DataType in YUI, especially for i18n
    • date-functions.js, used especially by JQuery datetimepicker plugin
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the date/time format produced from a date / picker which
I need to get the current volume of the output to the sound card.
my current json output is id:3,name:test, and I need the 3 to be 3.
I need to convert now() to GMT0. SELECT now(); should output current time in
I currently need to search a table of items to validate a list of
I'm setting up a podcast. For cross-browser support, I currently need to upload a
Currently I need to run two queries to get both the total amount of
Currently i need to construct and update large xml files. So what is the
I am currently in need of a bit of brain training and I found
I'm currently in need of a purely managed code DirectX wrapper for .NET. While

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.