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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:47:48+00:00 2026-05-30T12:47:48+00:00

I got some troubles using time in my code: txtDauer = new JFormattedTextField(); txtDauer.setFormatterFactory(new

  • 0

I got some troubles using time in my code:

txtDauer = new JFormattedTextField();
txtDauer.setFormatterFactory(new DefaultFormatterFactory(
    new DateFormatter(DateFormat.getTimeInstance())));

When I use setValue(0) to the above FormattedTextfield the textfield shows 01:00:00 instead of 00:00:00.

The same problem occurs also at another line of the code with this method:

public static String convertLongToString(Long time) {
    String strtime = new SimpleDateFormat("HH:mm:ss").format(time);
    return strtime;
}

Using this method with “0” it returns strtime = “01:00:00”.

  • 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-30T12:47:49+00:00Added an answer on May 30, 2026 at 12:47 pm

    The problem is the TimeZone, your default computer’s TimeZone is GMT +1.

    The solution is setting GMT to +0:

    DateFormat df = new SimpleDateFormat("HH:mm:ss");
    df.setTimeZone(TimeZone.getTimeZone("GMT"));
    

    Run and preview.

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

Sidebar

Related Questions

I have just installed Delphi 2010 and got some troubles with idHTTP component. If
I'm having some trouble understanding a bit of code. I've got 2 classes Company
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
I got some legacy code with that caption spread out as comment almost in
I got some legacy code that has this: <?PHP if(isset($_GET['pagina'])==homepage) { ?> HtmlCode1 <?php
I'm trying to get started using git, but I'm having some troubles right away.
I've got some troubles with Get-WmiObject and usage of this object. In case, I'm
I've got a problem with some legacy Java code that renders PDF files. We're
I've got some trouble with a git setup I wanted to use in our
I've got some YouTube embedding code (I will paste only code which is causing

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.