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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:57:25+00:00 2026-05-23T16:57:25+00:00

In my app I am converting the date string which is in CST format

  • 0

In my app I am converting the date string which is in CST format (Thu jun 03 10:00 CST 2011) when I am converting into the date object it is converting it to the current time zone like Pacific Asia etc, but I want the same string which is given I don’t want any time zone changes.

Thanks,
balu.

  • 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-23T16:57:25+00:00Added an answer on May 23, 2026 at 4:57 pm

    Use the code given below. The use of locale is optional as it controls the language in which the date string appears. The important piece is the correct use of TimeZone. Try the code with different settings for Locale and TimeZone to see how the output changes. For example if you change Locale to: Locale('fr','FR') the program will output: 13 juillet 2011 08:05:31 PDT instead of July 13, 2011 8:05:52 AM PDT. Notice that the timezone is still PDT as we have not changed the TimeZone.

        Locale locale = new Locale("en","US");
        TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
    
        Calendar date = Calendar.getInstance(tz,locale);
    
        DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
        df.setTimeZone(tz);
    
        System.out.println(df.format(date.getTime()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

An accountancy package, which I am converting to a web app, often has table
Basically, I'm getting a date time string from an API, and I want to
I have a Joda Date Time object that contains date and time fields and
Since Android introduced library projects, I've been converting my app into a library so
I'm converting an old app that records folder sizes on a daily basis. The
I'm converting a legacy app from ISO-8859-1 to UTF-8, and I've used a number
I'm converting a Carbon app to a Cocoa app and I can't find the
I'm about to get started converting a C# based desktop app to be web
Possible Duplicate: Converting XML to JSON using Python? I'm doing some work on App
I am from a c# background and am converting a vb.net windows forms app

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.