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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:05:36+00:00 2026-06-16T02:05:36+00:00

I want this format 6 Dec 2012 12:10 String time = 2012-12-08 13:39:57 +0000

  • 0

I want this format 6 Dec 2012 12:10

  String time = "2012-12-08 13:39:57 +0000 ";

  DateFormat sdf = new SimpleDateFormat("hh:mm:ss");
  Date date = sdf.parse(time);

  System.out.println("Time: " + date);
  • 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-16T02:05:37+00:00Added an answer on June 16, 2026 at 2:05 am

    You need to first parse your date string (Use DateFormat#parse() method) to get the Date object using a format that matches the format of date string.

    And then format that Date object (Use DateFormat#format() method) using the required format in SimpleDateFormat to get string.

    String time = "2012-12-08 13:39:57 +0000";
    
    Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(time);
    String str = new SimpleDateFormat("dd MMM yyyy HH:mm:ss").format(date);
    
    System.out.println(str);
    

    Output: –

    08 Dec 2012 19:09:57
    

    Z in the first format is for RFC 822 TimeZone to match +0000 in your date string. See SimpleDateFormat for various other options to be used in your date format.

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

Sidebar

Related Questions

I want to show a date string in this format: Jun 27, 2012 .
I want the date&time to be in this format. For example 2012/3/21 23:47:01 2011/11/23
I want to change this date format: Tue Apr 3 15:00:03 GMT+0300 2012 to
i want to display the current date in this format Wednesday march 28,2012 ,
Facebook returns 'created_time' in this format: 2012-07-23T08:52:04+0000 I want to convert this timestamp to
I want to set date in this format MMM dd, yyyy HH:mm, I hede
Hi at all I want to parsing a date from XML with this format:
New to Regex. I want to validate to this format: Any character allowed, except
I want to convert this string format: 11/2013 TO 201311 So, suppose my string
I have some String values like this format, [INFO] [Tue Aug 21 14:54:22 2012]

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.