Date comparision issue with different date formats

Hi Friends
I am trying to find difference in hours between two dates but not able to do that as the formats of both dates that i have are different.
But i have both the dates in the String format. belwo is my code.
First Date is in the format - yyyy-MM-dd-HH.mm.ss.SSS. String sDate = "2011-05-29-13.50.44.050761";
Secong date is in the format - yyyy-MM-dd HH.mm.ss String uiDate = "2011-05-29 13.50.44";
Now i need to parse both the Strings into a Date object and format that so that i can subtract both dates using the
long difference = uiDate .getTime() - sDate.getTime();
Can you please let me know how i can do that as the format of both the dates are different.
Is there a way like a common format to which these both can be converted and calculation done.
any suggestions and solutions would be of great help.

Thanks All for your suggestions
well i figured out the solution with some goggling and r&d.
For the first case I was getting the Date and Time fields from the UI as two different fields. I then combined these into a Date object and set the format for the first date as yyyy-MM-dd-HH.mm.ss.SSS.
The second date was already in the above format. Then the i just did the Date comparison and got the difference in hours which was what i wanted.
Vikeng

Similar Messages

  • Premiere pro cs5 : audio and video sync issue with .aiff file format

    I am using premiere pro cs5 on MAC and facing issue with audio and video sync  using .AIFF file format for audio unable to make it work.
    Is there any solution to this issue or any work around?
    Thanks in advance.
    Vinay

    Hi,
    hmmm, well that settles that...
    Here's a link to info about an open source free program to convert....for mac
    http://www.ehow.com/how_5072563_convert-files-wav-files-freeware.html
    Good luck
    Rod

  • Check material availability and goods issue with different BOM no

    dear expert:
    please find the below scenerio
    1. finished goods contain finished garments which contain washed garments accordingly>sewing garments>print panel>cut panel>fabric
    2. before going production we need to check all the component materials as well as their components are available or not.
    3. so our idea is we will create one BOM no 7 which will contain all components under finished goods. and we need to check material availablity with this BOM no
    4. successively we will split the BOM into different group and assign them under different components as applicable in BOM no 1 which we wants to use while issue.
    please suggest whether it is possible and if yes then how can i do this.
    best regards
    javed iqbal

    Dear,
    Requirement: System issue Warning / Error message in case of movement quantity is more than available quantity - safety stock quantity while making goods movements.
    This is actual requirement - Ex. Material un-res stock = 10 pcs and material master safety stock set as 5 pcs. So, if any reservation, goods issue, transfer postings done with quantity 7 pcs - system issue message as ' on date xxxxx only 5 pcs available' (i.e 10 available - 5 safety = remaining 5 relevant for movement).
    For this Dynamic availability check created with checking rule and assing rule with trasaction OVZ9 and OMB1 similar for Reservations.
    Make the message to be shown either Warning or Error and transaction types also assign the rule.
    BUT do suggest to do regression test cross functionality wise whether any where this message breaking background operations like - auto reservation from production , sales order etc.
    Regards,
    Syed Hussain.

  • Issues with different versions of Oracle.DataAccess.dll

    I have a .net web service application which references version 10.2.0.100 of Oracle.DataAccess.dll. A client has setup Oracle 10g database on the server, but I think the server has a patch set installed so it appears that the versions of Oracle.DataAccess.dll in my web service and on the database server do not match. When I issue a query via the web service on my local machine using my oracle 10g client, the web method returns the correct data. If I issue the same query using the same .net web service on the clients database server, I get the following error: Oracle.DataAccess.Client.OracleException: ORA-00923: FROM keyword not found where expected. There's nothing wrong with the query syntax, I can run the same query from SQL Plus on the database server and get the correct data. Could it be a compatibility issue between the Oracle.DataAccess.dll referenced in my web service application and the file on the sever. I'm not sure what else to look for, any advice is greatly appreciate, and I can answer any questions if needed.
    Thanks,
    NA

    I would not expect an ORA-923 if your the Oracle client was not installed properly. I would expect an exception or a crash.
    You can run an ODP.NET trace to find out what query is getting the ORA-923 by doing the following:
    1) Shutdown web server on the machine that runs the webservice (middle tier),
    2) In windows registry, on the machine that runs the webservice (middle tier), change registry value \\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ODP.NET\4.112.1.1\TraceLevel to 1
    3) Reproduce the ORA-923 only
    4) shutdown webserver
    5) Undo the registry value (set it back to 0)
    6) In the generated file (c:\odpnet2.0.trc) do a search for "923", hopefully you can find it. Just before that error, you should see the SQL that was executed. This will obviously not be what you expect and will hopefully point you to the cause of the problem.

  • Issue with Numeric characters format 10.000,00

    Hi,
    I am getting following error when I am generating the report from the XML output:
    "An error encountered either due to invalid Template details or due to null Data Input Stream." This error come only if the system profile "ICX: Numeric characters" is set to 10.000,00 during the XML output generation.
    If I am generating the XML output with "ICX: Numeric characters" is set to 10,000.00 then I am generating the report from that XML, it supports both the number formats.
    So, the solution I am looking for is, generate the XML output always with '10,000.00' format, irrespective of the system profile option "ICX: Numeric characters". Please suggest me how to do that. Also please let me know if there is any alternative way to achieve my requirement.
    Thanks
    Sanjeeva

    Hi ,
    Please set the following before submitting the request :-
    declare
    l_set_options boolean;
    l_nls_numeric_characters varchar2(2000);
    begin
    l_set_options := FND_REQUEST.set_options (numeric_characters => P_NLS_CHARACTERS);
    end;
    if you always want it as 10,000.00 then
    P_NLS_CHARACTERS = '.,';
    else
    you can get nls_numeric_characters value from fnd_concurrent_requests table for the parent program.
    or
    fnd_profile.get('ICX_NUMERIC_CHARACTERS', l_nls_numeric_characters);
    Thanks
    Padmaja
    Edited by: Padmaja on Sep 15, 2010 12:01 PM

  • LSMW load a file with different record format

    anyone can help me out here?
    I am trying to load a file which has exactly same record format except for the first line, and the first line is not neglectable. If i want to load this file to SAP within one LSMW load, is it feasible?
    thanks in advance.

    LSMW records fields screen by screen.  When you have recorded your LSMW, the country code, company code and personnel area are in the first screen.  So, this data must be on every line of your data file.
    Example of how your data file should be:
    Country     CoCd      Pers.Area         Field1DataLine1          Field2DataLine1         ...
    Country     CoCd      Pers.Area         Field1DataLine2          Field2DataLine2         ...
    Country     CoCd      Pers.Area         Field1DataLine3          Field2DataLine3         ...

  • ACS 5.0 having issues with different subnet AAA Clients

    Dear All,
    I am getting weird issue. My ACS 5.0 is in subnet 10.1.1.0/24. All the AAA clients which are in the same subnet can communicate with the ACS but different subnet cannot.
    I have checked the firewall between them, Its allow any any with all services.
    One more thing I have faced today is that now from only one switch (10.1.2.10) can access ACS but switches in the same subnet (10.1.2.0/24) cant access ACS as same previous issue.
    Following are the logs of one switch(10.1.2.10) in different subnet can access ACS :
    Working Switch with Same configuration:
    SW-A#test aaa group tacacs+ test cisco legacy
    Attempting authentication test to server-group tacacs+ using tacacs+
    User was successfully authenticated.
    SW-A#
    *Nov 17 00:05:52.041: AAA: parse name=<no string> idb type=-1 tty=-1
    *Nov 17 00:05:52.041: AAA/MEMORY: create_user (0x1B1FD04) user='test' ruser='NULL' ds0=0 port='' rem_addr='NULL' authen_type=ASCII service=LOGIN priv=1 initial_task_id='0', vrf= (id=0)
    *Nov 17 00:05:52.041: TAC+: send AUTHEN/START packet ver=192 id=3237327729
    *Nov 17 00:05:52.041: TAC+: Using default tacacs server-group "tacacs+" list.
    *Nov 17 00:05:52.041: TAC+: Opening TCP/IP to 10.1.1.2/49 timeout=5
    *Nov 17 00:05:52.041: TAC+: Opened TCP/IP handle 0x1B44D48 to 10.1.1.2/49
    *Nov 17 00:05:52.041: TAC+: 10.1.1.2 (3237327729) AUTHEN/START/LOGIN/ASCII queued
    SW-A#
    *Nov 17 00:05:52.243: TAC+: (3237327729) AUTHEN/START/LOGIN/ASCII processed
    *Nov 17 00:05:52.243: TAC+: ver=192 id=3237327729 received AUTHEN status = GETPASS
    *Nov 17 00:05:52.243: TAC+: send AUTHEN/CONT packet id=3237327729
    *Nov 17 00:05:52.243: TAC+: 10.1.1.2 (3237327729) AUTHEN/CONT queued
    *Nov 17 00:05:52.444: TAC+: (3237327729) AUTHEN/CONT processed
    *Nov 17 00:05:52.444: TAC+: ver=192 id=3237327729 received AUTHEN status = PASS
    *Nov 17 00:05:52.444: AAA/MEMORY: free_user (0x1B1FD04) user='test' ruser='NULL' port='' rem_addr='NULL' authen_type=ASCII service=LOGIN priv=1 vrf= (id=0)
    Logs from the same subnet switch (10.1.2.20) which cannot access ACS:
    SW-B#test aaa group tacacs+ test cisco legacy
    Attempting authentication test to server-group tacacs+ using tacacs+
    No authoritative response from any server.
    SW-B#
    *Oct 20 00:54:12.834: AAA: parse name=<no string> idb type=-1 tty=-1
    *Oct 20 00:54:12.842: AAA/MEMORY: create_user (0x1A6F3F0) user='test' ruser='NULL' ds0=0 port='' rem_addr='NULL' authen_type=ASCII service=LOGIN priv=1 initial_task_id='0', vrf= (id=0)
    *Oct 20 00:54:12.842: TAC+: send AUTHEN/START packet ver=192 id=3281146755
    *Oct 20 00:54:12.842: TAC+: Using default tacacs server-group "tacacs+" list.
    *Oct 20 00:54:12.842: TAC+: Opening TCP/IP to 10.1.1.2/49 timeout=5
    *Oct 20 00:54:12.842: TAC+: Opened TCP/IP handle 0x1B1E888 to 10.1.1.2/49
    *Oct 20 00:54:12.842: TAC+: 10.1.1.2 (3281146755) AUTHEN/START/LOGIN/ASCII queued
    SW-B#
    *Oct 20 00:54:12.943: TAC+: (3281146755) AUTHEN/START/LOGIN/ASCII processed
    *Oct 20 00:54:12.943: TAC+: received bad AUTHEN packet: type = 0, expected 1
    *Oct 20 00:54:12.943: TAC+: Invalid AUTHEN/START/LOGIN/ASCII packet (check keys).
    *Oct 20 00:54:12.943: TAC+: Closing TCP/IP 0x1B1E888 connection to 10.1.1.2/49
    *Oct 20 00:54:12.943: TAC+: Using default tacacs server-group "tacacs+" list.
    *Oct 20 00:54:12.943: AAA/MEMORY: free_user (0x1A6F3F0) user='test' ruser='NULL' port='' rem_addr='NULL' authen_type=ASCII service=LOGIN priv=1 vrf= (id=0)
    Waiting for your responses.
    Regards,
    Anser

    Ok, cool,
    So this usually means that the switch is sourcing the requests from a difernet interface that is configured on the ACS.
    I would guess that the ACS is reporting unknown NAS...
    Can you please use the "ip tacacs source-interface" command to make sure the switch will source the Tacacs+ packets from the interface with the IP address for which you have the ACS configured to?
    HTH,
    Tiago
    If  this helps you and/or answers your question please mark the question as  "answered" and/or rate it, so other users can easily find it.

  • Download Issues With Different Browsers

    I'm using a simple, simple download example app to fetch a
    file from a tomcat server. It seems to work fine on Mozilla
    fireFox, but when I use it with safari or opera I get the following
    error;
    quote:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File
    I/O Error.
    at
    flexDownloadExample/init()[/Applications/apache-tomcat-5.5.1/webapps/flexDownloadExample/ src/flexDownloadExample.mxml:40]
    at
    flexDownloadExample/___flexDownloadExample_Application1_creationComplete()[/Applications/ apache-tomcat-5.5.1/webapps/flexDownloadExample/src/flexDownloadExample.mxml:2]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\co re\UIComponent.as:9051]
    at mx.core::UIComponent/set
    initialized()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1167]
    at
    mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:698]
    at Function/
    http://adobe.com/AS3/2006/builtin::apply()
    at
    mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\sr c\mx\core\UIComponent.as:8460]
    at
    mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src \mx\core\UIComponent.as:8403]
    I have absolutely no idea why this is. I havent been able to
    test this in internet explorer, but i'm guessing it will show the
    same error. My question then is, why is it that the code below
    works for one browser and not for another?

    Font Rendering
    Every browser and operating system and browser and operating sytem version (just about) renders text differently. Chrome on Windows is currently the worst at rendering text, since it's using an old Windows API which uses an outdated anti-aliasing algorithm for the text. So text in Chrome on Windows generally looks worse that text drawn in other browser or on other operating systems. Typekit has a 7 part blog post here <http://blog.typekit.com/2010/10/05/type-rendering-on-the-web/> about all the ins and outs of font display in different browsers and operating systems.
    Scroll Effects
    Scroll effects are measured from the top of the browser window. Thus when the height of the browser window differs, even on the same computer, where the top of the browser window is relative to your objects when the page is scrolled all the way to the bottom will differ. Without the URL for your site/page, this is only a guess, but I suspect this is what you're encountering.
    Several customers have asked for an option to set the key position as a distance from the bottom of the browser window rather than always being from the top in order to create items that have a specific final location when a page is scrolled all the way to the bottom, but Muse doesn't currently have that feature.

  • How to find a word with different font format (e.g. italic and regular in one word)

    Hi people,
    I need to find a word, prefferably using GREP or simple Find/Replace tool.
    Sometimes, when I get source text to paste into InDesign, some word's format is messed up. First letter is italic and rest is regular or otherwise (or any other font format). How can I find such words automatically. For example:
    Example
    would really appreciate any help.
    best regards
    JMG.

    Hi,
    If I had to do that, using Multi-Find/Change, I would play it like:
    With MFC, I create a set of the 2 regex. So, one click to fix your problem.

  • ADOBE READER (9.4.1) prints several files from one Word doc with different pages formats

    I work with Word for Mac, version 11.6.1
    When I have one document with several pages setup (say different sizes, or landscape and vertical orientation) and I need to convert to PDF, I got several PDF files, one for each page section of my document.
    How can I get only one PDF for my whole document ?
    Thanks a lot.
    STURIONE
    Santiago - Chile
    Feb 05, 2011

    Thank you, MichaelKazlow, for your reply/suggestion.
    Actually, I'm not very familiar with this kind of technology, so I'll do my best trying to find out solution following your recommendation.
    Tks again.

  • Authorization issue with different programs

    Basicly, when I for try to authorize programs, I give the authorization so I can use the full version, but when I turn off my mac and turn it back on, it always asks for the authorization again. Maybe it's meant to be like that, but I can remember my mac not having to ask for authorization on programs ever again once they've been authorized. It's kinda really annoying having to re-enter those authorizations over and over again.
    It's the same with java applets, when I check the box to always allow applets like that run, it always asks it again the next time anyway. It's just annoying.
    It's like my mac just won't "save" those settings
    Any ideas how to fix this?

    Try creating a new user account and see if it works right there. If it does, there is something in your user account that is wrong, likely a permission issue.
    From there, we can try to figure out why it is doing that.

  • How to make a multi-clip with different footage formats?

    Have an hour-long concert shot with three cameras plus a separate high-quality audio track.
    Cameras 1 & 2 are the same format (HDV 1080p30).  Camera 3 is DSLR footage from Canon 5D (imported into FCP7 using Log & Transfer).
    I used PluralEyes to sync everything up, and created a Multiclip -- but that multiclip isn't working properly when I drag it into a new sequence.  (It makes me render the whole thing before I can even work with it -- and then it won't work anyway.)
    Help ...

    OK.  For testing, I converted the DSLR to HDV (can do ProRes later).
    The Multiclip still does not work.  It DOES work if it's just cameras 1 & 2, but when I add camera 3 (the DSLR) -- the sequence wants to render and then when I select "Open" to work with the multiclip, it doesn't work.
    I don't understand what's wrong, because all three camera clips were used with PluralEyes and all three have the exact same settings (HDV 1080p30, 1440 x 1080, 29.97 fps).
    What's wrong?

  • Using DisplayPixels with different image formats

    According to the comments in PIGeneral.h (in the PSPixelMap declaration), the DisplayPixels function can handle only grayscale, RGB, CMYK, and Lab images, plus Duotone and Indexed if it matches the document's format (presumably because the function wants to use the palette from the document). I have a multichannel image that I'd like to draw.
    The question is, is there any way to get Photoshop to convert this to a usable format for me? Since I don't know the channel characteristics, I don't think I can do it myself. Alternatively, is there a way to deduce the conversion from the ReadChannelDesc structures in the FilterRecord? Does anybody have code to do this?
    Thanks,
    Aaron

    Hi Mathias,
    this is not possible issuing just one request. You would need to repeat the request changing the format.
    Joao

  • Microsoft compatibility issues with attachements and formatting

    I received MacBook as a gift, along with purchased iwork software. The gift giver was told that iwork would be able to work with Microsoft users without problems. Now that a project is due, I find that Microsoft users cannot:
    open attachments from Pages or Numbers or, if on the rare ocassion that they can, they receive a very small copy.
    Most of my work is done with Microsoft users and we will be exchanging tables and spreadsheets.
    Question 1--- was the gift giver mis-informed that iwork works with Microsoft Excel and Word?
    Question 2---if not mis-informed, what am I doing wrong or what am I not doing that makes it impossible for attachments from iwork to be opened by Microsoft users?
    Question 3---if mis-informed, what have people found to interact exceedingly well with Microsoft Windows users?
    Thank you so much for any advice.

    Thank you SO much! Just tested it and it worked beautifully at the other end.....in excel, word and PDF form. I had searched a # of "help" and "support" venues with with many different search terms and never successfully found this info for some reason
    I can assure you that you have done a great deed today as some important docs involving a bunch of children needed to be delivered within a few hours.
    Have a great weekend and go into it knowing you've made a difference in a lot of lives just by taking the time to answer a simple question.
    Thank you again, Dennis!
    sjz

  • Audio issues with different types of sound cards

    For some reason different clips in Final Cut Pro are barely hearable depending on the audio card. The better speaker systems do fine but the basic set up can't play the clip without losing half the sound. This is a school broadcast so please let me know as simple as you can Thanks

    Hi WildcatPubs,
    Welcome to the Support Communities!
    What camera model are you working with?  Does it have 5.1 Surround Sound?
    Can you provide some additional details about the type of audio system you're using to play back that doesn't sound loud enough in Final Cut Pro X?  Are you playing back directly from the Mac's built-in speakers or connecting to a set of headphones or speakers?
    Have you adjusted the volume level and playback device in System Preferences so that other applications have sufficient audio level?
    Here's how:
    Mac Basics: Set your preferences
    http://support.apple.com/kb/HT2490
    Cheers,
    - Judy

Maybe you are looking for

  • Day link - want Item to contain day number from calendar

    I'm a bit stymied here. Using the calendar, I would like to add a branch to a page based on the DAY of the calendar that the user clicks on. For example, if the calendar is on the screen, and the user clicks on day number 15, then I would like that "

  • ITunes 10.6.1 cannot connekt the iTunes store

    iTunes 10.6.1 can not connekt the store?

  • Drag and drop onto AIR to start AIR with a file

    Is it possible to drag a file onto an AIR application icon to START the application using that file? I'm aware that once the AIR app is open files can be dragged into it and it will also open the application when a file is dragged onto it (if the fil

  • Best method for exporting from iMovie?

    I have been having a lot problems with exporting from iMovie. I have a 30 minute movie that I want to compress to a file around 400~500mbs. I found the best results with Divx and .Avi files. Unfortunately, after I installed Tiger, I noticed that the

  • Add shutdownhook in jdk 1.1

    i need to do some cleanup operations when the jvm is shut down. In addition to normal exits , program termination using user interupts like ^C should also be taken into account and i'm looking for some method that can provide the functionality of Run