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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:25:15+00:00 2026-06-06T19:25:15+00:00

Is there a way I can get a date by the format MM/dd but

  • 0

Is there a way I can get a date by the format “MM/dd” but instead of the month being an int, it is a shortened string like “Jan 30”?

Currently I did this with Java by a simple Switch Case, but I want to know if this is already contained in a DateFormat or something similar.

Anyway I leave here my current code. I used R.string because my application has multi-language support.

public void setShortMonth(){
   final Calendar calendar = Calendar.getInstance();
   int Month = calendar.get(Calendar.MONTH);
   String ShortMonth = " ";
   switch (Month){
        case 0: 
            ShortMonth = getString(R.string.Jan);
            break;
        case 1: 
            ShortMonth = getString(R.string.Fev);
            break;
        case 2: 
            ShortMonth = getString(R.string.Mar);
            break;
        case 3: 
            ShortMonth = getString(R.string.Apr);
            break;
        case 4: 
            ShortMonth = getString(R.string.May);
            break;
        case 5: 
            ShortMonth = getString(R.string.Jun);
            break;
        case 6: 
            ShortMonth = getString(R.string.Jul);
            break;
        case 7: 
            ShortMonth = getString(R.string.Aug);
            break;
        case 8: 
            ShortMonth = getString(R.string.Sep);
            break;
        case 9: 
            ShortMonth = getString(R.string.Oct);
            break;
        case 10: 
            ShortMonth = getString(R.string.Nov);
            break;
        case 11: 
            ShortMonth = getString(R.string.Dec);
            break;
        }
        TextView datetxt = (TextView) findViewById(R.id.home_date);
        datetxt.setText(ShortMonth + " " + Day);
}
  • 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-06T19:25:16+00:00Added an answer on June 6, 2026 at 7:25 pm

    Try like this:

    final Calendar calendar = Calendar.getInstance();
    SimpleDateFormat formatter = new SimpleDateFormat("MMM dd"); // 3-letter month name & 2-char day of month
    TextView datetxt = (TextView) findViewById(R.id.home_date);
    datetxt.setText(formatter.format(calendar.getTime()));
    

    You can see a list of available format options here.

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

Sidebar

Related Questions

Is there any way I can get a share picker like the one seen
Is there any way to get the time and date format from the 'Language
Is there any way I can get my Python code syntax highlighted in Microsoft
Is there any way I can get VS2008 to provide further detail on how
Is there any way I can get jQuery to perform a function when you
Is there a way I can get this array walk with my anonymous function
Is there a way I can ask Visual source safe to get all the
Is there any way can declare a bean in just like JSP UseBean in
I know I can get the local timezone offset via new Date().getTimeZoneOffset(). But where
Is there any way I can get django to store my data in postgresql

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.