Finding a date in another timezone

Hi everyone.
I'm struggling with this one and hope you can help.
Basically what i tried to do is this:
Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
cal.getTime();
I was hoping this would give me a date object with the date and time in Kuala Lumpur, but no. I have tried several different solutions, but it just doesn't work and i'm getting frustrated.
How can i get the time in Kuala Lumpur and other plaes around the world. Important that the DST also works.

cal.getTime();That does always return a date/time in UTC. Displaying it as time in Asia is a presentation issue and can be handled by SimpleDateFormatter.
Kaj

Similar Messages

  • How to convert date in one timezone to date in another timezone?

    Hi,
    I am building a web site which can be accessed by people across world in different timezones. I have a requirement to collect the data from the users in their respective timezones and convert it to the timezone in which the server is hosted before saving it. E.g. a user in "Kwajalein" timezone (GMT - 12) enters date as "10/23/2007 21:00", the time for the server which is hosted in indian timezone (GMT + 5.30) would be "10/24/2007 14:30". If I use the following program to convert the dates in these timezones it gives me wrong output.
    TimeZone tz = TimeZone.getTimeZone("Kwajalein");
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm");
    df.setTimeZone(tz);
    Date d = df.parse("10/23/2007 21:00");
    TimeZone tz1 = TimeZone.getTimeZone("Asia/Calcutta");
    df.setTimeZone(tz1);
    System.out.println("date in IST-->" + df.format(d));
    The output of this program is
    date in IST-->10/23/2007 14:30
    The formatter has changed the time component however it hasn't changed the date. It still appears as 23.
    Am I doing anything wrong here?
    Please pass your comments.
    Thanks,
    Shashi

    Please see the following link it may be helpfull to you
    1) http://forum.java.sun.com/thread.jspa?threadID=755558
    2) http://myhowto.org/java/36-all-about-locale-sensitive-time-processing-in-java/

  • Get date from another TimeZone

    Hi,
    I have to get the time from a timezone that is not the current timezone. So, I do the following:
    TimeZone timeZone = TimeZone.getTimeZone("America/La_Paz");
    Calendar calendar = Calendar.getInstance(timeZone);
    long longTime = calendar.getTime().getTime();
    Time time = new Time(longTime);
    If I print the time using:
    wdComponentAPI.getMessageManager().reportSuccess(time.toString());
    the output is right, but when I set this same Time instance to a context element (with Time type) that is linked to an InputField, that InputField shows me the time of the current TimeZone.
    Any Ideas?
    Thanks in advance
    Michel Cabral
    Edited by: Michel Amaral on Feb 7, 2008 8:58 PM

    Michel-
    Introduce this method in your -others- section of your controller:
      private Time getDateInTimeZone(Date currentDate, String timeZoneId)
      TimeZone timeZone = TimeZone.getTimeZone(timeZoneId);
      Calendar aCal = new GregorianCalendar(TimeZone.getTimeZone(timeZoneId));
      aCal.setTimeInMillis(currentDate.getTime());
      Calendar cal = Calendar.getInstance();
      cal.set(Calendar.YEAR, aCal.get(Calendar.YEAR));
      cal.set(Calendar.MONTH, aCal.get(Calendar.MONTH));
      cal.set(Calendar.DAY_OF_MONTH, aCal.get(Calendar.DAY_OF_MONTH));
      cal.set(Calendar.HOUR_OF_DAY, aCal.get(Calendar.HOUR_OF_DAY));
      cal.set(Calendar.MINUTE, aCal.get(Calendar.MINUTE));
      cal.set(Calendar.SECOND, aCal.get(Calendar.SECOND));
      cal.set(Calendar.MILLISECOND, aCal.get(Calendar.MILLISECOND));
      return new Time(cal.getTimeInMillis());
    Usage:
    Time t = getDateInTimeZone(new Date(), "PST");
    Create an attribute of type time in your context and set it to this value.
    Cheers-
    Atul

  • Can't find my data file to back up, so I can uninstall and reinstall the software. (Windows, Vista & Palm version 6.0.1)

    I can't find my data file, in order to back it up.  After going to Documents - Palm One, the only thing that looks like a user name is a file with no data.  Somewhere there has to be another file with all my data, since data is available when I open the Palm One software on my computer.  After backing it up, I want to uninstall and reinstall the Palm One software.  I'm hoping this resolves my inabilty hot sync.  Thanks!  Lauraflavin.
    Post relates to: Tungsten T5

    If you're using XP, your data is here:
    C:\Program Files\Palm (or PalmOne)\ your Hotsync Name abbreviated \
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How do I find the date my MacMini was manufactured?

    It seems to me I used to know how to find the date of mfg for Mac computers under About This Mac. Is this still true?
    -Joe

    A quick way it to just enter your serial # at > Klantenservice: Serienummers
    Another is at > How to identify Mac mini models

  • I'm moving an internal hard drive from an old computer to a new computer.  How do I transfer the catalog data to my new computer so the Organizer of Photoshop Elements 6 will find the data on the hard that has been moved to the new computer?

    I'm moving an internal hard drive from an old computer to a new computer.  (My new compute runs Windows 8.1) How do I transfer the catalog data to my new computer so the Organizer of Photoshop Elements 6 will find the data on the hard that has been moved to the new computer?  Is this possible or do I have to use the procedure of copying the catalog along with the photos to a back up hard drive and then restore them on the new computer?

    The 'normal' procedure is to do a PSE organizer backup (not a copy or a backup from external tools) to an external drive, then a restore to the new location.
    The advantage is that you have a backup of both catalog and media files and you don't have all disconnected files, which would happen with external backup tools. Also, if you restore with a more recent elements version, the catalog will be automatically updated to the new format.
    The drawback in your situation is that you'll have either to overwrite all your files or restore to a custom location, creating a duplicate photo library (which supposes you have enough free space).
    It would be possible to simply use the organizer in the old PC to move the catalog to a new 'custom' folder just under your C: root drive. The catalog would be accessible once the drive will be installed in the new PC. Then you would have all files 'disconnected' due to the fact that all your media files are now on a drive with a different letter. Reconnecting a whole library is a hard job with PSE6, less so with PSE11/PSE12.
    If the idea of fiddling with the sqlite database with external sqlite manager tools is ok for you, I can describe the process more in detail. You only copy your catalog folder (as suggested above) to another location. Instead of trying the 'reconnection' way, you install the sqlite utility on the new computer. When the old drive is installed in the new computer, you simply edit a given record in the catalog database, catalog.psedb, and start the organizer with your copied catalog by simply double clicking the 'catalog.psedb' file.
    Even if the last solution is much, much quicker, I would still create a new PSE backup : you have never too much safety .

  • How can I  extract non-cumulative cube data to another cubes ?

    Dear Expert,
             I copied inventory cube 0ic_c03 to  a new cube : ZIC_C03  , then I loaded the data of 0ic_c03 to the new cube ZIC_C03 . 
    the loading was sucessful, but  the result of  report of the ZIC_C03 was not correct. After looking into the problem, I found out
    the new cube can successfully extract data related with "Goods movement" & "Revaluation", yet the extract of "Open Balance" does not seems to work.
             I have read through Note:375098, in which I could not find (InfoObject 0RECORDTP) in my start routine as mentioned in the solution
    ,and the note was not mentioned valid for BW 3.5 release.
             How can I  extract non-cumulative cube data to another cubes correctly in BW3.5 release SP20? 
       Thanks !

    Hi,
    Check Routines in Update rules wether same code is wrriten in  new cube
    cheers,
    Satya

  • How do I reload my bookmarks if I can't find the 'date.json' file in my backup?

    My hard drive crashed and everything had to be retrieved and reinstalled. I have a folder of old Firefox data but can't find the 'date.json' file that is indicated to open in the troubleshooting instructions. Is there another option?

    Hello,
    If you have the latest Firefox version, the ''places.sqlite'' file is what holds your bookmarks. Please see the article [[Recovering important data from an old profile]] for more information.

  • Fetch data from another mirosoft sql server to sap

    Dear all,
                   I want to fetch data from another mirosoft sql server
                    to SAP(my sap server IN unix, oracle 10g).
    Thanks
    Shashi
    Moderator Message: Try to do you own research before posting your question. Get back to the forums in case you are stuck with any issue
    Edited by: Suhas Saha on Jul 26, 2011 3:21 PM

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • Chrome missing in Import data from another browser

    I use both chrome and firefox portable from site portableapps because mozilla doesn´t have a portable version.
    My dilemma today is this:
    I always had on firefox on menu "import and backup" > > "import data from another browser" listing chrome like this
    https://support.mozilla.org/media/uploads/gallery/images/2012-02-24-10-35-53-97ff60.png
    today i want to import chrome bookmarks to firefox but chrome is missing on the list, in the past i always had it there listed now is just pointing to IE
    Do i need chrome installed on machine to grab something from registry?
    By what i can remember always had that option on portable versions, i am importating this with a fresh pc machine because i installed now windows where i previously wiped the disk from manufacturer erasing tool.
    i digged the net and on questions here but cant find why its missing, can you guys tell me why?
    P.S- i would like to say that this site, Mozilla and Mozilla support, forums and community are the best service i´ve seen in years over the whole web i believe its really the best one and am not writing this because of this question, only thing missing is having Mozilla apps portable, a online chat would be cool too for the community
    Oh god i hope today the "fox" saves me cause i can´t find solution on this
    You guys take it easy.....

    Do you mean the portable version of Google Chrome as well?
    *http://portableapps.com/apps/internet/google_chrome_portable
    Which that version you probably need to export the bookmarks to an HTML file and import that file in Firefox.
    You can open the Bookmarks Manager in Google Chrome (wrench icon > Bookmarks > Bookmarks Manager) and select "Tools > Export Bookmarks"<br />
    This will export the Chrome bookmarks to a file bookmarks.html.<br />
    You can import that file in Firefox: Bookmarks > Show All Bookmarks > Import & Backup > Import HTML : "From File"
    * http://www.google.com/support/chrome/bin/answer.py?hl=en&answer=96816 - Bookmarks : Import or export bookmarks - Google Chrome Help

  • Accessing data from another computer - a strain on my computer?

    My wife has an IBM Thinkpad laptop that is not connected to the internet. My computer is connected to the internet and sometimes she accesses her e-mail on it by clicking on a bookmark that I set up for her that links directly to her e-mail at work. Her entire work e-mail system (microsoft pc based) appears on my computer and she logs in. All of her e-mails (thousands) are on my computer including huge documents and such. I suspect that doing this may be causing my computer to freak out a bit.
    I only have 1GB of RAM. I once typed in the name of the bookmark "Ann's e-mail" into "spotlight" and it appears as though all of her work e-mails seem reside on my hard drive. One time she was checking her e-mail and a kernel panic happened. She's stopped checking her e-mail on my computer and the kernel panics no longer happen. Perhaps this is a coincidence but in general, do all her e-mails reside on my hardrive all the time or only when she clicks on the bookmark and logs in. Lately she doesn't even have to log in. All e-mail appears when she clicks on the bookmark. In the past it always asked for her password first. (I find it strange that it no longer asks for her password) ) She's going to be getting her own internet connection soon but does anyone know if bookmark that links to a ton of data on another computer uses up RAM or CPU on my computer?? Should I delete the bookmark?

    It sounds like you should be doing Internet Sharing on yours, is that not the case?
    Thank you for your reply, BDAqua. I haven't but doing internet sharing.
    Upgrade your RAM to 2 or 2.5 GB.
    I was told at the Apple store than the model I have will not allow any additional upgrades. When I bought the unit it had 512MB and I had 1GB of memory put in the only other remaining memory slot. So I actually have 1.5 GB RAM. AT some point I'm be getting a new computer in order to get 4GB RAM but can't afford it right now.
    What interface do you connect with, what interface does she connect wirh, and what is available on both?
    Sorry, don't understand this question. Do you mean how do I get the internet? I have Road Runner from Time Warner Cable. My wife's home laptop isn't connected to anything. She wants to get an Air Card so she can access the internet when she travels.

  • Can a vi. send data to another .vi when ONLY the internet is between?

    I seem to have hit a hurdle.
    - I have one computer behind a Firewall at a university. This computer has a MIO-16E card in it. No administrative privileges to run datasocket server.
    - I have another computer(laptop)with an E series MIO that I have full privileges on, but project requirements only allow me to find wireless connection points so there is only the internet as a medium between the two.
    - If possible, I would like to pass a one way data stream from the university(UT).vi side to the Laptop .vi. By I could accept the dataflow in the other direction.
    Things I have tried: I can do Remote Panel where the UT machine controls the laptop (good); but, if scenario is switched, the laptop cannot use Remote Panel to control the UT .vi. Of course web browsers and User interfaces do very little for me since the DAQ and control signals will be unmanned.
    If someone has experience on how to make one .vi can send data to another .vi using just the internet, I would truly appreciate some advice. And, to be honest, I am solely a hardware individual and have not figured out how/what to setup for this experiment.
    Thanks for your time.

    SDGhwrtech wrote:
    I seem to have hit a hurdle.
    - I have one computer behind a Firewall at a university. This computer has a MIO-16E card in it. No administrative privileges to run datasocket server.
    - I have another computer(laptop)with an E series MIO that I have full privileges on, but project requirements only allow me to find wireless connection points so there is only the internet as a medium between the two.
    - If possible, I would like to pass a one way data stream from the university(UT).vi side to the Laptop .vi. By I could accept the dataflow in the other direction.
    Things I have tried: I can do Remote Panel where the UT machine controls the laptop (good); but, if scenario is switched, the laptop cannot use Remote Panel to control the UT .vi. Of course web browsers and User interfaces do very little for me since the DAQ and control signals will be unmanned.
    If someone has experience on how to make one .vi can send data to another .vi using just the internet, I would truly appreciate some advice. And, to be honest, I am solely a hardware individual and have not figured out how/what to setup for this experiment.
    Thanks for your time.
    If your labtop has a well known IP address/name you could always create a little TCP/IP server in LabVIEW and run it on that computer. Then have the university computer regularly try to connect to that labtop computer and on success start streaming the data you want to the server. The server then will receive the data and do something with it.
    Take a look at the VI examples in examples/comm/tcp.llb. Especially the Simple Data Client.vi and Simple Data Server.vi might be interesting for you.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Find UTC offset for pacific timezone

    I have two file names,
    GST564_14Mar10_01-50-35.RAW
    GST564_14Mar10_03-06-42.RAW
    The file name contains the date the file was created on the server.  The server time is Pacific Time, either PST or PDT.  In this example, the first is in PST and the second is in PDT.
    I need a vi to convert the time to UTC according to the timezone rules for Pacific Time, and then display the time using the local time of the computer (regarless of its timezone).  You can see in the vi how I do this manually in the attached vi. Is there a way to use the various date/time functions to figure out whether the offset should be 7 or 8 based on the name/time?
    Thanks.
    -Dan
    Attachments:
    time.vi ‏15 KB

    Dan,
    OK, I was misunderstanding your request.
    Do the file go back before the last change in Daylight Savings Time dates (2007)?
    If not, here's the limits:
    Effective in the US in 2007 as a result of the Energy Policy Act of 2005, the
    local time changes from PST to PDT at 02:00 LST to 03:00 LDT are on the
    second Sunday in March and the time returns at 02:00 LDT to 01:00 LST on
    the first Sunday in November.
    There is not a simple way to make this automated and flexible to the PC's local time.
    However, you can determine the initial time zone with fairly simple, but not quick to write, code. 1) Find the year of the fileand create complete timestamp
    2) Find the date for the Sundays and create timestamps
    3) Compare timestamps to determine if PST or PDT
    4) Adjust file timestamp to UTC (subtract 7 or 8 hours)
    5) Convert back to PCs local time
    However, if you have any control over the file naming, save as UTC in filename.
    Then all this effort is unnecessary and the code in LabVIEW is simple.
    I attached an example that shows how simple this would be with UTC in the filename.
    In addition, I placed an extra TimeZones control that might be handy as a reference.
    Good Luck,
    James
    Attachments:
    time UTC.vi ‏13 KB

  • Importing calendar data from another [dead] computer

    My G5 recently died on me, and I'm currently using an older computer (eMac) that's still running 10.4. But I still have access to my G5's hard drive through a FireWire connection. What I'm trying to find a way to do is to reload all my G5 iCal data into my eMac's iCal app. Obviously, I didn't know my computer was going to die on me, so I didn't export an iCal file beforehand. So, assuming all my old calendar data is still on my G5 hard drive, what files will I need to copy over to my eMac? And will there be any complications bringing iCal info from 10.5 over to 10.4?
    Thanks a lot for any help.

    firebane08 wrote:
    > Is there a way I can import XML data from another
    website say for example a web
    > api and convert the date for use in Dreamweaver. I have
    tried coding this in
    > several possible ways but have failed in getting the
    data to display. Are
    > there any extensions that will allow me to do this? Any
    help would be
    > appreciated. Thanks.
    It was my understanding that browsers prevented this from
    happening.
    Dooza
    Posting Guidelines
    http://www.adobe.com/support/forums/guidelines.html
    How To Ask Smart Questions
    http://www.catb.org/esr/faqs/smart-questions.html

Maybe you are looking for

  • Problem in using WS_DELIVERY_UPDATE(updating the deliveries)

    Hi Gurus, Iam facing problem  i updating the deliveries using the fm WS_DELIVERY_UPDATE..This is the code.. MOVE : lwa_mchb-matnr   TO lwa_vbpok-matnr,                    lwa_mchb-charg   TO lwa_vbpok-charg,                    lwa_mchb-lgort   TO lwa

  • Verify SCXI chassis: Configurat​ion specifies a SCXI -1600 module but nothing was detected

    Hello NI Engineer, I am using SCXI 1001 chassis with SCXI 1600 control module, SCXI 1520 signal conditioning module and SCXI 1314 connector block to acquire data from strain gage. Once I right clicked SCXI 1001 under device and Interfaces in MAX>> te

  • Tcode for Open POs

    Hi all, Please tell me the Tcode to search the list of open POs. Thanks in advance Regards, Neetu

  • Initialising F4-Value-Help for date

    I want the F4-Help for a date field to show a month different from the current one. By default the month containing sy-datum is displayed. I want the popup to start in another month. I tried already to create a search help and setting the startdate i

  • MOVED: Anywhere i can buy an i/o plate?

    This topic has been moved to Intel P4 & Celeron P4 based board. https://forum-en.msi.com/index.php?topic=97130.0