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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:50:01+00:00 2026-05-19T17:50:01+00:00

Given a string like: Sun Feb 06 2011 12:49:55 GMT-0800 (PST) How can you

  • 0

Given a string like:

Sun Feb 06 2011 12:49:55 GMT-0800 (PST)

How can you convert that to:

Feb 6

And / Or

Sun Jan 26 2011 12:49:55 GMT-0800 (PST)
to: Jan 26

Any ideas?

  • 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-19T17:50:01+00:00Added an answer on May 19, 2026 at 5:50 pm

    There aren’t any built-in formatting functions to use here, you just have to use the Date methods to build the string:

    var months = [
        'Jan', 'Feb', 'Mar', 'Apr',
        'May', 'Jun', 'Jul', 'Aug',
        'Sept', 'Oct', 'Nov', 'Dec'
    ];
    
    var d = new Date();
    // Or,
    var d = new Date('Sun Feb 06 2011 12:49:55 GMT-0800 (PST)');
    
    alert(months[d.getMonth()] + ' ' + d.getDate());
    

    Or, if that string will always stay in that format, you can simply extract the relevant parts without converting it to a date object first:

    var str = 'Sun Feb 06 2011 12:49:55 GMT-0800 (PST)';
    var components = str.split(' ').slice(1, 3);
    components[1].replace(/^0/, '');
    alert(components.join(' '));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a string like #fff443 or #999999 How do I verify that the string
Given a string like x@gmail.com, b@yahoo.com, c@ebay.com How can I, using ruby, see if
I was given a string like example.com/test?region=us&lang=en&jurisdiction=us How can I write the java code
How do I create an array in smarty from a given string like 22||33||50
Given a string like this: a,string, with,various,values, and some,quoted What is a good algorithm
Given a string like so: Hello {FIRST_NAME}, this is a personalized message for you.
Given a string like String a=- = - - What is your name?; How
Given a string like the following in JavaScript var a = 'hello world\n\nbye world\n\nfoo\nbar\n\nfoo\nbaz\n\n';
Given a string object like this: twohundred = 200 What is the difference between
Given an HTML string like: <span class=findme id=31313131313>The Goods</span> What kind of REGEX in

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.