Date converting to less one day while transferring from client to server

Hi,
I have very typical problem. My application is in java, we are using oralce 9ias. The problem when the server is running in german locale and client is running in english. We the date value is passed from client to server it is converting to one day less.
i.e.
If i want to search with records jan 02,2005,
on server side if we print the value it is getting as jan 01,2005.
Can anybody help me in solving the above problem.
Its bit very urgent.
Thanks in advance
regards
Kalyan

well, i have had nightmares with this problem. here are the reason and soln:
reason:
in ur DB, u r using a field "Date" which does not include time information. Hence, any date will be taken at 00:00:00. If such a date is opened in some other timezone, which is ahead of the server timezone, the date differs by one. This is becoz java always considers the millisecond info encapsulated in the date, calendar.
soln:
Step 1:
u must be able to get the "timeZoneOffset" from a calendar object. This timeZoneOffset will give the number of minutes/seconds/hours... by which the system is offset from GMT.
Thus if u create a calendar in India, the timeZoneOffset will be 330. If you create the calendar in UK, it will be 0.
To achieve this, we have made an object-UTCDate. This class encapsulates a Calendar. It has a function called "getTimeZoneOffset".
Step 2:
Once u get the timeZoneOffset, here is what u need to do in ur code. (assume that the timeZoneOffset is in minutes. the variable names will be self-explanatory)
at the client side code:
long timeInMillis = calendar.getTime().getTime() + (timeZoneOffsetOfTheCalendarReceivedFromServer * 60 * 1000 ) - (timeZoneOffsetOfClient * 60 * 60 )
use timeInMillis to make a new Date Object and use this date object.
at the server side code:
long timeInMillis = calendar.getTime().getTime() + (timeZoneOffsetOfTheCalendarReceivedFromClient * 60 * 1000 ) - (timeZoneOffsetOfServer * 60 * 60 )
hope this helps.
regards

Similar Messages

  • Converting date value one day less while transfering from client to server

    Hi,
    I have very typical problem. My application is in java, we are using oralce 9ias. The problem when the server is running in german locale and client is running in english. We the date value is passed from client to server it is converting to one day less.
    i.e.
    If i want to search with records jan 02,2005,
    on server side if we print the value it is getting as jan 01,2005.
    Can anybody help me in solving the above problem.
    Its bit very urgent.
    Thanks in advance
    regards
    Kalyan

    // to get  current time in Germany
        Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("Germany"));
        int hour12 = cal.get(Calendar.HOUR);
        int minutes = cal.get(Calendar.MINUTE);    
        int seconds = cal.get(Calendar.SECOND); 
        boolean am = cal.get(Calendar.AM_PM) == Calendar.AM;
        //I think all you need to do is to set the timezone to the current, so that when the
    //server at some other timezone gets this date it knows that this date belongs to
    //different timezone and gets converted automatically according to the server
    //timezone settings.
        // Set the current local timezone
        cal.setTimeZone(TimeZone.getDefault());
        int hour24 = cal.get(Calendar.HOUR);
      Hope this answers your question. Good luck.
    -Sreekanth varidhireddy

  • TS4605 Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Well, iCloud has nothing to do with this.
    Do you have the built-in backup function Time Machine running on your Mac?
    See: http://support.apple.com/kb/ht1427

  • 2004s Excel Export of Date is incremented by one day

    Hi, When I export a report with dates to Excel the dates are incremented by one day.  An OSS search turns up nothing.  Anyone have any idea why this would happen?  We are on 2004s sp10.
    Thanks,
    Ken Murray

    ANyone have any ideas why my report dates would increment by 1 day when uploading to excel?  This only happens with the JAVA Web Version and not the ABAP Web Version
    Thanks!

  • My iPod Touch 4G just shut off one day while i was using tap to post. tried everything and nothing is working not even iTunes! Is there any hope for me? my iPod is my LIFE!!!!!!!!!!!!!!!! oh by the way none of this happened until i updated to iOS 6.

    My iPod Touch 4G just shut off one day while i was using tap to post. tried everything and nothing is working not even iTunes! Is there any hope for me? my iPod is my LIFE!!!!!!!!!!!!!!!! oh by the way none of this happened until i updated to iOS 6.

    I have not had any experience in getting any devices repaired so I'm not sure which store to resort to. An official Apple store should more than likely get you what you need, but I'm guessing it's probably more expensive. (if any cost for your situation)
    I hope you get your problem resolved.
    ~Lt. Leviathan

  • Date on Call Log one day ahead - How do i fix this...

    Hi all,
    Hope someone can help.
    I look after the company phones and I have been approaced by a couple of users who have had the same problem.
    The date that appears in the call log for any call seems to show one day ahead. i.e. calls today appear as 31/05/13.
    I have tried the battery / hard reset and then called it and it is still the same.
    Look forward to hearing from you.
    Kind regards

    Heather,
    Can you help me figure out why all of your Holiday's are different from your other events?
    When/how were these Holiday events entered?
    Have you checked iCal>Preferences...>Advanced>Turn on time zone support?

  • BOXI3.0: Formula for subtract/deduct one day or more from date field

    Greetings. Its Alias.
    I have one question. Actually I already post this question but at designer forum.
    I am using SQL.
    Example I have Order Date field and from this field I want to subtract the date by minus one day or two days or three days, etc.
    I got the solution for designer (example):
    DATEADD (dd , -3, EPJ_IPMS.dbo.DO_DATA.DO_DATE_D)
    But at webi level it does not work.
    I also do not understand why at designer and webi level may have different SQL select statement.
    Can someone help me please.
    Best regards,
    Alias

    Hi there Prashant.
    In my case here is I am using Microsoft SQL Server Enterprise Manager and the data is save inside it.
    The Designer and Webi are using same SQL database.
    I also created an Object at Designer and the result is good.
    But say if I don't want to create the object at Designer and let user create their own variables at webi.
    Meaning to educate user to put the variable and formula themselves.
    This is where the SQL statement a I mentioned earlier cannot be used at webi.
    Best Regards,
    Alias

  • Shopping cart line items are missing while transfering from ITS to EBP

    Hi everyone
    I am Raghu, working on EBP (version 2.0)
    Some shopping cart line items are missing while transferring the shopping cart data from ITS to EBP.
    For example in my shooping cart 4 items are there,during transferring shopping cart data from ITS to EBP all 4 items are getting updated for all the shopping cart related tables except account assignment table.
    In account assignment table for this particular shopping cart only 3 items are updated and usually the first line item gets missed out.Hence the the system fails to create the follow on documents in R/3. 
    This is happening randomly for few of the shopping carts that too most of the cases first item of the shopping cart was not updating reqacct table(this is account assignment table for shooping cart items).
    I have debugged entire scenario,but  couldn't find the cause for this..
    Can any one  please advise me....why this is happening?
    Your immidiate ersponse will surely help me a lot.
    Thanks,
    Raghu

    Hi Yann
    Thanks for your support.
    Yes, we are using EBP2.0/CRM 2.0C & the support pack level is SAPKU20C23.
    Please advice
    Thanks
    Raghu

  • Data Records are missing in between while loading from R/3 (ECC) to BI.

    Dear Experts,
    I have created a custom DataSource on Custom Function Module.  This datasource contains 600 fields. (I know its a monster and splitting options are thinner).
    1) Validate the data using RSA3 in R/3 and showed the correct record count.
    2) Validate the data by debugging the FM, still showed the correct record count.
    But while loading from R/3 to BI, records are missing.
    Various Scenarios load from R/3 to BI:
    1a) Loaded full load (78000 records) with all default data transfer settings.  PSA showed up with 72000 records (missing 6000) only.  Compared the Idocs vs data packets, both reconciled.
    1b) Loaded full load (78000) with modified settings (15000 KB / data packet).  PSA showed up with 74000 records (missing 4000) only.
    2a) Loaded with selection parameters (took a small chunk) (7000 records) with default data transfer settings.  PSA showed up only 5000 records (missing 2000).
    2b) Loaded with selection parameters (7000 records) with modified settings (15000 KB / data packet).  PSA showed up all 7000 records.
    3a) Loaded with selection parameters (took further small chunk) (4000 records).  PSA showed up all records regardless data transfer settings.
    Also please look at this piece of code from the function module,
    IF l_wa_interface-isource = 'ZBI_ARD_TRANS'.
          l_package_size = l_wa_interface-maxsize DIV 60.
        ENDIF.
    I really appreciate your advise or help in this regard.
    Thanks much,
    Anil

    Hi,
    Which module u want?
    if its SD(for example)
    steps>>
    1>In AWB goto "business content"
    2> goto "Info provider"
    3>Under infoarea select SD cubes
    4> Drag related cubes and ODS to right panel
    5> Set the grouping option "In Data flow before&afterwards"
    6>Install the collected objects
    Go to R/3
    7> Use Tcode RSA5 Transfer all regarding SD module datasources
    Goto BW
    8> Right click on the source system "Replicate datasources"
    [DataSources|http://help.sap.com/saphelp_nw70/helpdata/en/3c/7b88408bc0bb4de10000000a1550b0/frameset.htm]
    Edited by: Obily on Jul 10, 2008 8:36 AM

  • Form Opening is Very slow while opening from client PC

    We are running forms application in 10.1.2.0 application server. We have a peculiar issue of slowness while opening forms from client PC's and not while opening from application server itself.
    1) When opening the form from a Windows 7 PC it takes around 25 seconds
    2) When opening the form from a Windows XP PC it takes around 15 seconds
    3) When opening the form from the application server itself it took less than 3 seconds .
    In essence all forms when opened from application server are opening very fast and when opened from client PC's it takes undue time. What might be the reason for the same, can anyone help us and we are pondering over this issue for some time. What are the files of interest to be visited for these kind of issues. We enabled tracing level 5 in JRE and could not find any thing fishy over it.
    Request application server and forms experts to participate and help us to resolve.
    Thanks in advance.
    Edited by: ramarun on Sep 9, 2010 8:27 PM

    Hi ramarun,
    In etc/host file, enter hostname and IP Address entry in client machine...
    or try to access application via IP Address.
    I hope it will work for you...
    Regards,
    Ajinkya

  • While connecting from Client to EJB , LookUp Error is Comming...

    Hi All
    I am working with Oracle Application Server 10g.
    Here I downloaded one helloworld session bean from oracle site.
    I am able to deploy .ear file.
    But when I am connecting bean using client...
    I am getting following error:
    D:\helloworld>ant run
    Buildfile: build.xml
    init:
    setup:
    cli-classes:
    [javac] Compiling 1 source file to D:\helloworld\build\helloworld\helloworld-client
    cli-descriptor:
    cli-jar:
    [jar] Building jar: D:\helloworld\dist\helloworld-client.jar
    run:
    [java] client started...
    [java] java.lang.InstantiationException: Error communicating with server: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
    [java] at com.evermind.server.ApplicationClientContext.createContext(ApplicationClientContext.java:63)
    [java] at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:145)
    [java] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
    [java] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    [java] at javax.naming.InitialContext.init(InitialContext.java:219)
    [java] at javax.naming.InitialContext.<init>(InitialContext.java:175)
    [java] at hello.HelloClient.main(HelloClient.java:25)
    [java] NamingException: Error reading application-client descriptor: Error communicating with server: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
    [java] java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
    I used the following JNDI Configurations:
    java.naming.factory.initial=com.evermind.server.ApplicationClientInitialContextFactory
    java.naming.provider.url=ormi://localhost:23791/helloworld
    Pls Post your results....
    With Regards
    Kumar

    Try this:
    java.naming.factory.initial=oracle.j2ee.rmi.RMIInitialContextFactory

  • How comes that, having everybody issues with infinitely long backups (combining mountain lion on new imac and time capsule) apple doesn't fix it? (my time machine forecasts not less than 6/8 days to complete the first one, 350 gig transferred from a pc,).

    Within 6 days someone will switch off the machine, or power will go off, or some error will occur. I will have a backup when I'll have to replace this new Imac....

    Always do the first backup at least over ethernet.. even if you have to use the TC in complete isolation from the network. You should be able to do that backup in about 6-8hours, ie overnight.
    The setup is easy.. in complete isolation.. if you have no ethernet from the imac.. just use a short patch lead.. plug LAN port of the TC into the iMac. Turn off wireless in the imac. Make sure the airport utiity can locate the TC, if not press reset on the TC and it will go back to router mode.. ignore all the errors .. just locate the hard disk is working.. start up TM and point it to the TC.. do the backup.
    Once this backup is done.. the hourly incrementals over wireless should take just a couple of minutes. Although if you are manipulating very large files then you may need to consider getting better connection, either using 5ghz wireless which is much faster but might need extender.. or ethernet or ethernet over power type adapters.

  • Updation of function group while transfering from one server to anather

    Hi all,
    In my client's quality server some function module . And the unicode check activity for the function group is checked for some user in quality and not checked for some user (might be somebody has changed it and created a new task for the function group). But in development it's working fine.
    If i'll create a Transport request for the function group and transfer it weather it will overwrite everything on quality and will work fine.  while creating a TR for that function group what object type i should select(limu fugt or limu fuct).
    regards
    sandeep

    Hi
    When you create aNew Transport request for that Function Group and transport it will over write the entire thing in Quality with the new one.
    Since it is working fine in DEV it should also work fine in Quality
    Use the following object type (FUGR) to add in the request
    R3TR-FUGR-<name>
    Reward points if useful
    Regards
    Anji

  • I backed up my data 3 times in one day does all data from those backups get restored?

    Does everything backup on a certain date get restored?

    I'm using iCloud to backup my iOS device (an iPad). I believe it's using the latest backup. SO ... the latest backup and what data is in it, will be what I get back again, if I do a restore.

  • I lost pictures while transfering from iphone to mac, how to get then back?

    I lost 952 pictures after transferring then from my Iphone4 to Iphoto on my mac... While iphoto was finishing the transfer, it asked me if i would like to delet photos from iphone and I answred Yes... but some problem happens to Iphoto, and I have had to do the "force quit" with it... after all... when I opened Iphoto to see the pictures... it was not there... neither in my Iphone... Where I can find it back??

    You get one download only.
    It has always been very basic to always maintain a backup copy of your computer files/docs/pics/music/etc.
    Use your backup to put everything back.
    You can try contacting itunes support and asking for an exception, but they are under no obligation to allow it.
    http://www.apple.com/support/itunes

Maybe you are looking for

  • Ipod touch not being recognized by itunes now

    i have a friend who has an ipod touch....everything had been going fine for him and then all of a sudden it was not being recognized any more....what caused this? he did say that he had done an update but i'm not sure what version he has....could thi

  • Multiple finder crashes on brand new MBP

    I just purchased the 2.53 GHz MacBook Pro two three ago and have had a ton of finder crashes and restarts. It's not been anything worse than annoying, but it's still very disconcerting to have the desktop disappear for a few seconds. At least it alwa

  • Error: Untrusted Server Certificate

    When i click on Query Interfaces (IPS Manager: Configuration > Settings > Interfaces) i get the following error: An error occurred trying to get the interface information. An error occurred while trying to determine the sensor version. Detail = Error

  • Multi-plot cursor in xy graph

    I am using an XY graph with 5 curves which belong to one of two y axes each. All curves share the same array of x values. I do not like the cursor legend so I want to read out the values of the one cursor programmatically. I can create a multi-plot c

  • Won't start up after software update

    I have a PB G4 titanium 1ghz running 10.4.11. Just ran the latest software update which installed the latest security update, iTunes and QuickTime. At the end of the process the screen went black so I powered down by holding down the power button. Tr