Internationalization  issue : convert date/time to GMT/UTC

We have our webservices running in websphere /oracle.There is this requirement to internationalize the application ...like
a) language .....
d)Internatiolization of time :
For this requirment I am planning to do the following.Service request with date will be converted to GMT before it is stored in database and the response back will be converted from GMT back to the time zone of the requester and have the application server/database server configured to UTC time.Is this a good strategy or is there a better one.
Thanks
m

Manjit wrote:
Sabre,to confirm again...you are suggesting that there is even no need to change the oracle Date field from Date type to Timestamp.The only thing I really have to do is for display purpose convert/format the response date to the zone the request is coming from.Please let me know if I missed anything.The above statement is indefinite.
Are you starting with a java.util.Date or perhaps a java.sql.Timestamp?
Then you do NOT convert them. You display them. You use SimpleDateFormat for that. You do not concern yourself at all with timezones exception in terms of creating a SimpleDateFormat. And that is ONLY an issue if you are creating the string (display value) on a server. If you are doing that you will need the client to provide you with a timezone. There is no magic way to get that from the client. If a client app is doing the display the the client is running in a client VM and that VM will already have a display format that might be suitable.
Conversely if you are receiving a timestamp value as a text value (say read it from a file) then you must convert that into a java.util.Date. You do that via SimpleDateFormat. The specifics of how you do that depends on the form of the text value.

Similar Messages

  • Convert date/time to GMT format

    Hi,
    I want to convert my current system date to GMT format. the class java.util.Time/Calender have methods which help u to convert from GMT to local time.
    is there a method to convert from current System Date to GMT.
    tx in advance

    i found the answer to my earlier question from the postings. Now i need help with the format og the Date in GMT.
    i used the following code to get the GMT based on the system time
    Calendar here = Calendar.getInstance();
    int gmtoffset = here.get(Calendar.DST_OFFSET)
    + here.get(Calendar.ZONE_OFFSET);
    //to convert to GMT time
    Date GMTDate = new Date(System.currentTimeMillis() - gmtoffset);
    the result of exceuting the following code is
    GMT Date is Mon Aug 20 18:39:19 EDT 2001
    but i need the GMT time in this format
    20010820-18:39:40
    tx
    Namrata

  • Convert date time local Timezone  to GMT

    I need to get GMT time...
    How to convert local time to GMT ?
         public static long getGMTNow()
             Calendar local = new GregorianCalendar();
             local.set(Calendar.HOUR_OF_DAY, 0);              
             local.set(Calendar.MINUTE, 0);
             local.set(Calendar.SECOND, 0);
             System.out.println(local.getTime());
             System.out.println(local.getTimeInMillis());
             Calendar gmtC = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
             gmtC.setTimeInMillis(local.getTimeInMillis());
             System.out.println(gmtC.getTime());
             return gmtC.getTimeInMillis();
         }Result :
    Thu Feb 12 00:00:00 EST 2009
    1234414800034
    Thu Feb 12 00:00:00 EST 2009
    1234414800034

    Calendar gpsTime = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
             gpsTime.set(Calendar.HOUR_OF_DAY, 10);              
             gpsTime.set(Calendar.MINUTE, 0);
             gpsTime.set(Calendar.SECOND, 0);
             System.out.println("gpsTime: "+gpsTime.getTime());
             Calendar realtime= new GregorianCalendar();
             realtime.set(Calendar.HOUR_OF_DAY, 5);              
             realtime.set(Calendar.MINUTE, 0);
             realtime.set(Calendar.SECOND, 0);
             System.out.println("realtime: "+realtime.getTime());
             System.out.println("COMPARETO : "+ realtime.compareTo(gpsTime));
             long timediff = realtime.getTimeInMillis() - gpsTime.getTimeInMillis();
             System.out.println(timediff/1000 + " sec");RESULT :
    gpsTime: Mon Feb 16 05:00:00 EST 2009
    realtime: Mon Feb 16 05:00:00 EST 2009
    COMPARETO : 1
    0 secOk, I done my homework. getTime() will allways return local time so I need to set the GPS time to a GMT Calendar to get the right result.
    Funny thing, look at the compareTo result....

  • Convert local time to GMT

    Hi everybody,
    i receive a lot of operation date from many worldwide ports like these:
    SINGAPORE 23/FEB/2011 13:50 (local time)
    GHENT(NL) 23/FEB/2011 12:00 (local time)
    i'm required to convert these information to GMT date.
    I've found NEW_TIME function but it seems inadequate:
    1) the function does not consider daylight saving periods; i mean when tmz1 switches from daylight savings on to daylight savings off and tmz2 does not, the function does not change the time difference (at least it's the result of my test unless all valid timezones switch at the same time)
    2) valid parameters are 18 therefore they don't cover all the possible combinations
    Could you please help to cope the matter ?
    Many thanks in advance
    Stefano

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by David Hsiung ([email protected]):
    How can i convert local time to GMT time in
    the Form?<HR></BLOCKQUOTE>
    David,
    there is a date function caled NEW_TIME that should work. For ex:
    select to_char(new_time (sysdate, 'EST','GMT'), 'HH:MI:SS')
    from dual;
    05:31:00

  • How convert date/time from xml in xdp(Designer)?

    Hi, i want to convert date/time format from xml in Designer, date/time value in xml is NOT in common format YYYY-MM-DD (if is in a common format i can do this with pattern)
    I have a "DateTime" Field in Xdp can get from Xml date and time:
    In XML <DateTime>DD-MM-YYYY</DateTime> i want to convert in XDP in DateTime Field in "DD-April-YYYY"
    Can i do this?

    You can do this way..
    Bind the date field to your XML tag.
    Set the display pattern for the date field.
    In the initialize event of the date field place the following code.
    Set JavaScript as language.
    var dtStr = this.rawValue;
    var pos1=dtStr.indexOf("-");
    var pos2=dtStr.indexOf("-",pos1+1);
    var strMonth=dtStr.substring(0,pos1);
    var strDay=dtStr.substring(pos1+1,pos2);
    var strYear=dtStr.substring(pos2+1);
    //Assign the formatted value to the Date field.
    this.rawValue = strYear + "-" + strMonth + "-" + strDay;
    Thanks
    Srini

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • How to convert date-time according to the Time Zone the client

    Urgent! Help wanted!
    I extract a date-time field (which is GMT time) from the central database but I need to convert it accordding to the TimeZone of the user and also the so-called winter time and summer time in the local. Any one has any good solution?
    Thanks.

    Use a Calendar, Timezone and Locale objects like this,
    TimeZone tz = TimeZone.getTimeZone("Germany/Berlin");
    Calendar cal = Calendar.getInstance(tz, Locale.GERMAN);
    long date = 0; // assign your central database value to this variable
    cal.setTime(new Date(date));
    Now you can use the Calendar object 'cal' to retrieve the time according to the set locale and timezone.
    These objects provide tonnes of features for finding out timezones and day light savings times. So check out the APIs as well.
    I hope this helps you out.

  • Date/time conversion from UTC to CET

    Hello,
    Jjust a little question to our SAP BI community!
    Is there a BI function/ggod way that converts a (datetime) string DDMMYYYYHH:MM:SS  in UTC time zone into a string DDMMYYYYHH:MM:SS in  CET timezone ?
    We receive this string in input in a flat file and need it to convert from UTC to CET.
    Or do you know any way to convert a date/time from IUTC to CET, eveen using an ABAP function?
    Thanks a lot,
    Matthieu

    Hi,
    Check this thread for time conversion from UTC to Local time
    [ABAP statement for converting UTC date/ time to local date/time],
    Regards,
    Daya Sagar

  • Convert date/time to a value in second

    Hello,
    I want to convert a basic date time variable into a numeric one corresponding to the time (in second) passed since January,1,1970 in order to put it in a SQL statment as a criteria.
    Is someone able to help me ?
    Regards

    If you have an java.util.Date object you can call getTime() method on it. It will return milliseconds. Just divide it on 1000. Here is example code:
    java.util.Date date = new java.util.GregorianCalendar(2001, 7, 6).getTime();
    long seconds = date.getTime() / 1000;
    //Your code
    Best regards, Alex.

  • Convert date/time to Unix epoch

    I have thousands of date time stamps I would like to convert to Unix epoch ten-digit strings. That is, take some thing like:
    Dec 9, 2005 10:24 AM
    and convert to
    1234567890 (only in the correct unix epoch time)
    What formula can I use? I've found that this "=DATE(1970,1,1)+P2/86400" can convert a 10 string epoch time down to just a date correctly, but without time. But I need to go in the opposite direction, with the time included.
    Using Numbers 09 ver 2.0.5 (368)

    CP,
    An up-to-date Unix Time would be provided by:
    =DUR2SECONDS((NOW()-"1/1/1970"))
    A somewhat more robust form would be:
    =DUR2SECONDS(NOW()-DATE(1970,1,1))
    If the time to be converted is in Cell P2, the expression would be:
    =DUR2SECONDS(P2-DATE(1970,1,1))
    Jerry

  • How do get current date/time in GMT?

    Is there any way to get the current date and time in GMT (while my current locale is not GMT)?
    In Java I can do this:
    long currenttime = System.currentTimeMillis();
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss z");
    df.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
    java.util.Date date = new java.util.Date();
    date.setTime(currenttime);But, there seems to be no way to do the equivalent in BPEL in SOA Suite.
    I did some research and I think I could appy the XPath 2.0 function adjust-dateTime-to-timezone() to the current time, but that function is not available.
    Using SOA SUite 11.1.13.0.
    THanks.

    have you tried changing the stylesheet version in the xsl to 2.0 and then try the function again ?
    by changing this version it was possible to use newer functions, which weren't available in the designer

  • FileMonitor issue for date time stamp change.

    Hi I have an app that runs with a minor issue and I am looking for some insight for a workaround or code change.
    I have a File Monitor that checks a specific directory every second.
    Users send a batch run to this directory throughout the day. There are two types of files, .ZIPs and .DONEs.
    So for each .ZIP a .DONE is sent to notify the app it can begin to process the file.
    Here is what I receive
    /elements/process/File1.ZIP     Oct 15 08:19
    /elements/process/File1.DONE     Oct 15 08:19
    The problem I am encountering is sometimes the .DONE and. ZIP are sent and the date time stamp of both files are the same so when the monitor reads the directory it looks like there is no change so both files sit in the directory and do not process. To make this work, I usually go in and touch a file to change the date time stamp.
    This is a java app that runs on an AIX box.
    Here is my code, is there anything any once can suggest to help me out. Thanks in advance.
       * Subclass of FileMonitor, Handles the timer event
       * @param none
      private class FileMonitorNotifier extends TimerTask
        public void run()
          // Loop over the registered files and see which have changed.
          // Uses the Modifed DateTimeStamp to determine if there was a change.
          // Use a copy of the list in case listener wants to alter the
          // list within its fileChanged method.
            try
                Collection files = new ArrayList (hmFiles.keySet());
                for (Iterator i = files.iterator(); i.hasNext(); )
                    File file = (File) i.next();
                    long lastModifiedTime = ((Long) hmFiles.get (file)).longValue();
                    long newModifiedTime  = file.exists() ? file.lastModified() : -1;
                    //      Check if file has changed
                    if (newModifiedTime != lastModifiedTime)
                        //      Register new modified time
                        hmFiles.put(file, new Long (newModifiedTime));
                        // Notify listeners
                        for (Iterator j = colListeners.iterator(); j.hasNext(); )
                            WeakReference reference = (WeakReference) j.next();
                            FileListener listener = (FileListener) reference.get();
                            // Remove from list if the back-end object has been GC'd
                            if (listener == null)
                                j.remove();
                            else
                                listener.fileChanged (file);
            catch(Exception ex)
                 m_odLaunch.logError(OdIntegrationConstants.ERROR_LEVEL_MIDLEVEL, ex);
         }

    Yes, I guess you are right, I don't care what time each file came, as long as I have both I can being to unzip and process and delete the .DONE.
    The code itself was based on if a filechanged then do work.... I could just take this out. Thanks!
    * This is the main entry point when there is a change to the modified date/time
    *  of the monitor directory
    * @param file directory we are monitoring
         public void fileChanged (File file)
              StringBuffer sbMessage;
              try
                   sbMessage = new StringBuffer();
                   //Make sure this is a Directory
                   if(file.isDirectory())
                        //Return list of files with extension we are looking for
                        File[] arFiles = file.listFiles((FilenameFilter)new FileSuffixMonitor(m_odLauncher));
                        for(int i=0;i < arFiles.length;i++)
                             sbMessage.append("Found file association to move-" );
                             sbMessage.append(arFiles.toString());
                             m_odLauncher.logInstance(sbMessage.toString());
                             processMoveFile(arFiles[i]);
              catch(Exception ex)
              sbMessage = null;

  • Convert Data time stamp to Local Time

    Hello,
    I want to convert this input to local time EST.
    Input:12/8/2006 10:23:00.000000000 PM -06:00
    o/p: EST.Local Time

    Is the input a string? A timestamp? If so, which flavor of timestamp? Something else?
    Normally, you'd want to use a TIMESTAMP WITH LOCAL TIME ZONE data type for this sort of requirement, since it automatically converts data to the client's time zone. Assuming the input is a string and that the client's time zone is set to EST
      1  select cast(to_timestamp_tz( '12/8/2006 10:23:00.000000000 -06:00',
      2                               'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM' )
      3                AS TIMESTAMP WITH LOCAL TIME ZONE)
      4*   from dual
    SCOTT @ nx102 JCAVE9420> /
    CAST(TO_TIMESTAMP_TZ('12/8/200610:23:00.000000000-06:00','MM/DD/YYYYHH24:MI
    08-DEC-06 11.23.00.000000 AM
    Elapsed: 00:00:00.01
    SCOTT @ nx102 JCAVE9420> Justin

  • Convert date/time to HEX command and write to a bin file

    Hello,
    I have to do the following thing. I have the date/time string, let's say 08:45:23, 12.08.09, where the hour, the minutes, the seconds, the day, the month and the year represent hex number or in other words I have the following command:
    Byte 0 - Byte 5
    0x08; 0x45; 0x23; 0x12; 0x08; 0x09;
    Now I want to write this command in a binary file in order to send thefile later throught serial RS232 connection.
    Now, I am not sure whether I write the command in the binary file in the correct format. What I simply do is to write it as a string
    ("084523120809"). Is this the correct way. I guess no, because when transmitted it does not work as expected.
    How can I write this string as a HEX command in the binary file?
    Thanks for the replies in advance
    IG
    Message Edited by igurov on 08-12-2009 01:51 AM
    Attachments:
    1(2).JPG ‏39 KB

    Do you know the difference between decimal and hex values? It's not the same, that the whole point, and it's why it doesn't make sense. Decimal 32 is not the same as hex 32. These are two different values, even though they both have the digits "3" and "2". The hex value will be the same as the decimal value up to the value of 9. In your example the hour is 8. In decimal this is 8, in hex this is 8. The minutes is 45. That's decimal. In hex, this is 2D, not 45, as you claim in your example. Hex 45 is a completely different number (and a completely different "pattern").
    Attachments:
    time hex.vi ‏12 KB

  • Convert Date Time field to Date & Time

    Post Author: Smita
    CA Forum: Crystal Reports
    I am new to Crystal XI  . I need to convert DateTime ("2007/04/04/04 09:49:05:00") format to Date and Time and then group a months data first by date and then by Time ( per Hour ).
    If someone can help ?
    Thanks

    Post Author: newcruser
    CA Forum: Crystal Reports
    Thanks
    This is easy...second group based on the second formula 'for each hour'.
    How you group by 15 minutes?.
    i want to group by every 15 minutes starting from 9 AM to 5 PM.
    First i need to create a time range and then use that time range to group?.  Or any other simple and best way to solve this?. Please help
    How to create time range from 9 AM to 5 PM?

Maybe you are looking for

  • Cypress Touchpad - DELL XPS 12

    Hello, I'm owner of a DELL XPS 12 convertable notebook which has as inpunt device an ATMEL maXTouchDigitizer (Touchscreen) and a Cypress touchpad. The touchscreen works like expected, after an installationen of a new Arch Linux System with desktop en

  • Adding a button when a system form is opened

    Hiya, I'm trying to add a button to a system form in vb.net.  For some reason when i run my code the button will add to the form succesfully only when I have that form open in SAP.  If the form isn't open I get the error 'Form - Not found'  Can anyon

  • Session logs for shop admin

    Hi Team, I need some inputs and help. We are using CRM ISA 6.0 SP06. We are using the webshop functionality. We currently analyze the errors in the webshop via the session logs which we have configured. Now, when we have done the same setup for shop

  • Can I replace my 60GB hard drive with this 250GB hard drive?

    Hi all, I've searched the forums and I do not see any mention of the suitability of a 250GB hard drive as a replacement for a 60GB hard drive in a Titanium Powerbook DVI 1GHz. Here is a link: http://www.ifixit.com/Apple-Parts/250-GB-5400-RPM-Western-

  • OSMF Caption Support

    Hi all, With the recent US legislation requiring online broadcasts to support closed captioning (Fall 2012 is the first deadline), I was wondering what the current and future state of captioning in OSMF. My understanding of the current state is that