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

  • Home
  • SEARCH
  • 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 6727365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:02:28+00:00 2026-05-26T10:02:28+00:00

I am collecting data from the call log. This is how I format the

  • 0

I am collecting data from the call log.
This is how I format the date of the call to my taste:

DateFormat datePattern = DateFormat.getDateInstance(DateFormat.FULL);  //Tuesday, October 18, 2011
Long datelong = Long.parseLong("1318950779497");
String date_str = datePattern.format(datelong);
Date date = new Date(date_str);
formatter = new SimpleDateFormat("d/M/yyyy");  //18/10/2011
newdateformatted = formatter.format(date);

This the time of the call:

DateFormat timePattern = DateFormat.getTimeInstance(DateFormat.LONG); //12:40:32 PM GMT+00:00

How can I format this? I want the 24 hour time code.

  • 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-26T10:02:28+00:00Added an answer on May 26, 2026 at 10:02 am

    Just make another formater just for the time:

    SimpleDateFormat timeFormater = new SimpleDateFormat("HH:mm:ss");
    timeString = timeFormater.format(date);
    

    Note the case-sensitivity of HH:mm:ss. The HH is what gives you the 24 hour time format.

    The following little test code works for me:

    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Test{
    
    
      public static void main(String args[]){
        Date today = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        String formated = formatter.format(today);
        System.out.println(formated);
      }
    }
    

    It outputs:

    15:57:11
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How many InsertOnSubmit should I call before calling SubmitChanges ? I'm adding data from
Part of a C# application I'm writing requires collecting data from a service provider's
I have a C# winform app that is collecting some data from console-based commands.
I am working to retrieve data from an API call. For the login part,
We have a data collection system that collects measurements from environmental sensors that measure
I need to populate a .net DataGridView from a collection physically (without data binding)
We have an application that will be collecting data and storing it in local
Are there any .NET frameworks for collecting data similar to Google Analytics, for example
I am developing large data collecting ASP.Net/Windows service application-pair that uses Microsoft SQL Server
I have an application which is supposed to retrieve data from a Website every

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.