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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:25:10+00:00 2026-06-03T09:25:10+00:00

I have a date that I get from a server formatted in EST like

  • 0

I have a date that I get from a server formatted in EST like this

05/07/2012 16:55:55 goes month/day/year then time

if the phone is not in EST how can I convert it to the timezone the phone is in?

it would be not problem if I got the time in milliseconds but I dont

EDIT:

ok now the time is not correct when formatting

                String sTOC = oNewSTMsg.getAttribute("TOC").toString();
                String timezoneID = TimeZone.getDefault().getID();
                DateFormat format = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
                format.setTimeZone(TimeZone.getTimeZone("EST"));
                String newtimezoneID = TimeZone.getDefault().getID();
                Date timestamp = null;
                try{
                    timestamp = format.parse(sTOC);
                    format.setTimeZone(TimeZone.getDefault());
                    timezoneID = format.format(timestamp);
                }catch(ParseException e){

                }

I convert it to “EST” then format that time to the default TimeZone but the time is always off by an hour, not sure why?

  • 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-03T09:25:11+00:00Added an answer on June 3, 2026 at 9:25 am

    Use the following code to get a UNIX timestamp:

    String serverResp = "05/07/2012 16:55:55";
    DateFormat format = new SimpleDateFormat("MM/dd/yy HH:mm:ss");
    Date date = format.parse(serverResp);
    

    Now you have the timestamp, which you know how to use.

    Here’s another question which covers conversion, in case you are curious: Android Convert Central Time to Local Time

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

Sidebar

Related Questions

I have a function that get the current weeknumber from the given date e.g.
I have a TDateTime value (that I get as result from EndOfTheMonth(date) ) to
I have been passed a date string that looks like this: Thu%20Mar%2011%202010%2015%3A09%3A11%20GMT%2B0000%20(BST) I want
I have a date and I would like to format the date like that:
I have a current Date object that needs to be incremented by one day
I have create a simple grid that retrieves data from a server through php.
I have a small IOS program and that get a time from a database
I have a table that get its rows from a MYSQL database <table id=table1>
I have a simple HTML file, that gets data from the server and outputs
Let's say I have a date that I can represent in a culture-invariant format

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.