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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:46:29+00:00 2026-06-10T21:46:29+00:00

i m creating date format like this : SimpleDateFormat sdf =new SimpleDateFormat(MMM d, EEE,

  • 0

i m creating date format like this :

SimpleDateFormat sdf =new SimpleDateFormat("MMM d, EEE, h:mm a");

i need a new line between date, month and time something like this

thus ,sep 6
4:25pm

so i made the following changes :

SimpleDateFormat sdf =new SimpleDateFormat("MMM d, EEE,"+"\n"+" h:mm a");

it did not give me anything just it created it in one line like this :

thus ,sep 6 4:25pm

so i took format object like this

SimpleDateFormat sdf =new SimpleDateFormat("MMM d, EEE,");
SimpleDateFormat sdf1 =new SimpleDateFormat(" h:mm a");

and did this :

sdf.format(calendar.getTime())+"\n"+sdf1.format(calendar.getTime())

but it again gives the same result

thus ,sep 6 4:25pm

calendar is a Calendar object.Any help will be appreciated!!

  • 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-10T21:46:30+00:00Added an answer on June 10, 2026 at 9:46 pm

    I think Android literally needs \n to appear in the string, not an actual newline character. So, you need to escape the backslash in your Java string, so something like this:

    String output = "Thus ,Sep 6" + "\\n" + "4:25pm";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in django I am creating data series using datetime.date() objects, like this: data.append([ddate, daily_score])
I am creating date using following code try { newdatetime = new DateTime(2012, 2,
I'm creating an app that should list the date and time when a button
When creating database tables I'm often stumped when trying to name my time/date/timestamp fields.
I am creating a line chart from an Analysis Services cube, with a date
What i'm trying to do is show date in more readable format like 3
I am creating a website with org-mode and would like to format the postamble
I'm creating a time line that is scrollable horizontally using the jQuery scrollTo plugin.
I need to echo internationalized time in different format for different languages. Now i
I'm creating a report that lists patient deaths by date and by doctor. There

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.