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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:32:20+00:00 2026-06-13T08:32:20+00:00

I have this date/2 word parsed from the database randomly: JAN 2012 FEB 2013

  • 0

I have this date/2 word parsed from the database randomly:

JAN 2012
FEB 2013
MAR 2014 

etc.

I want to make the month in variable a and the year in variable b.
The date is parsed in a span as such:

<span class="rt_item">DEC 2012</span>
  • 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-13T08:32:21+00:00Added an answer on June 13, 2026 at 8:32 am

    You can use regex for this:

    var regex = /([A-Z]{3}) ([0-9]{4})/;
    var matches = "JAN 2012".match(regex);
    var a = matches[1];
    var b = matches[2];
    

    Otherwise, use .split(" "):

    var matches = "JAN 2012".split(" ");
    var a = matches[0];
    var b = matches[1];
    

    Both methods demonstrated in this fiddle.

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

Sidebar

Related Questions

I have this string: Fri, 13 Jan 2012 04:26:42 PST I tries to parse
I'm running an update on my MongoDB from Python. I have this line: self.word_counts[source].update({'date':posttime},{$inc
i have this date's & Time's: date1: 10/04/2010 - Time: 08:09 date2: 11/04/2010 -
I have this: var date = new DateTime(2009, 12, 5); ... ... and need
I have something like this: [{'date': 1, 'value':5}, {'date':2,'value':3}, ...] and want to map
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have this form with a date input. echo $this->Form->create('Nodata'); echo $this->Form->input('date1', array('type' =>
I have this table: ID(INT) DATE(DATETIME) Under the DATE column there are a lot
I have this code for checking whether the Date is OK or not, but
I have this function which gives me ( for a current date ) -

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.