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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:14:40+00:00 2026-06-11T02:14:40+00:00

I am creating web application where I need to store timestamp/ date. The problem

  • 0

I am creating web application where I need to store timestamp/ date.

The problem is that I have hosted my site on one of the hosting site and hosting site is based on US. When the data is store, US timing are store and not my own country timing.

I believe I need to set the hosting server time to my country timing OR I need to convert the time before I save. I tried few code, however I am not getting.

Could someone help me how to convert the time in java?

When I print

 System.out.println(new Date());

I get US time and not my current time. I need to convert this time to show as per My country time i.e. Kuwait timing.

Edit 1

When I print date as System.out.println(new Date());, I get output as Thu Sep 06 11:07:49 EDT 2012 which means I am getting server time.

Now I want to convert this time to some country time, lets say Kuwait OR Any other country i.e. same time should be displayed as current country.

i.e. the time for country Kuwait should be Thu Sep 06 19:07:49 AST 2012

For India it should be Thu Sep 06 21:37:49 IST 2012

Edit 2

Questions with better wording Hope So

I have created a web application using JSF where my server is in US. I am storing timestamp in database. Now while printing the time, I will obviously get the time that is there in DB i.e. US data.

I am preparing report where I want to display data along-with timings.

+++++++++++++++++++++++++++++++++++
+   Name    +      Time           +
+++++++++++++++++++++++++++++++++++
+ Name 1    +  10/09/2012 10:11   +
+ Name 2    +  10/09/2012 21:11   +
+ Name 3    +  10/09/2012 17:11   +
+++++++++++++++++++++++++++++++++++

Now the problem is that those timings are as per US timing hence I need to convert those US timing to my country time where I am. I need to display this time where I am accessing internet i.e. if I am in kuwait, I need those timings as per Kuwait timings. If I am accessing this data in Dubai, I need to display report as per Dubai timings.

Could someone help how could I get rid of these problem?

  • 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-11T02:14:42+00:00Added an answer on June 11, 2026 at 2:14 am

    If you are using time manipulations you should use a Calendar Object getting an instance with the Calendar#getInstance(Timezone) static method, providing your a TimeZone object that corresponds to your timezone.

    If you have to print a Date object with a defined timezone get a DateFormat object and set its timezone to one that corresponds to your liking.

    Here is a sample:

    SimpleDateFormat dateFormat = new SimpleDateFormat(
                                    "yyyy.MM.dd G 'at' HH:mm:ss z", Locale.UK);
    dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+1:00")); //London?
    
    String fullDateUK = dateFormat.format(new Date());
    
    System.out.println(fullDateUK);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a web application that will have many users. Each user has
I have developed a web application that uses a web server and database hosted
We've got a Spring based web application that makes use of Hibernate to load/store
I am creating a web application in Java in which I need to run
I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
I'm creating a web application using spring mvc. I have started to incorporate the
I am creating a web application in ASP.net/VB.NET and I have an issue with
I am creating an web application and I at the point that i am
I have a web application that talks to R using plr when doing adaptive
I am currently responsible for creating a web based project management application for the

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.