Compare two dateTime with different timezone

HI, All,
I found a strange thing when compare two dateTime in BPEL;
In my BPEL process, client passed a date time to the process , and the process compare the date time with current data time.
1.client pass cutoffDate to process
2. in a switch activity, I compare cutoffDate with current date. code:
bpws:getVariableData('cutoffDate')<=xpath20:add-dayTimeDuration-to-dateTime()
but seems this compare ignored the timezone information.
For example:
cutoffDate=2010-03-05T06:17:38.838+00:00
currentDate=2010-03-05T14:10:38.838+08:00 this time =2010-03-05T06:10:38.838+00:00
but cutoffDate<currentDate == true... seems it ignored the timezone info..
This is a bug or I used a wrong compare function?
Thanks.
Edited by: Colin Song on Mar 5, 2010 3:28 PM

Hi Colin,
Please go through below link, there is topic about calculating difference between dates. Hope you find solution.
http://blogs.oracle.com/reynolds/2007/07/19/
Please let me know, if still not successful.
Thx,

Similar Messages

  • Comparing two numbers with different formats

    Dear Java developers
    I am trying to compare two numbers but they have different formats. long x = 8981261369, Object obj = "8,981,261,369".
    I am trying to see if this two values are equal which is the case in the example above except one has a thousand separator but not sure how to do that.
    How can I lose the thousand separator and just compare them as two long values.
    Your input will be much appreciated
    Thanks

    iu433 wrote:
    I need a generic way of doing this. Because sometimes the Object does not have a thousand separator. Can i use some kind of NumberFormat to do this.You'll need to know what formats the string (not the number--as already mentioned, numbers don't have formats) can have, and then try them one by one.
    Of course, there can be some ambiguity. Does "123,456" represent one hundred twenty three thousand four hundred fifty six, or is that comma a decimal separator, and it represents one hundred twenty three and four hundred fifty six thousandths?
    The point is, you have to have a clear definition of what formats are allowed and how to determine which one it is. There's no magic way for Java to do that for you.

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • I have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    i have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    Chris, I believe this link may have the information you're looking for. Welcome to discussions!
    http://docs.info.apple.com/article.html?artnum=300432

  • Can I use iCloud to sync two devices with different apples Ids?

    Can I use iCloud to sync two devices with different apple ID's

    What do you mean by "apple ID"?  There's an ID you can use at the iTunes store to buy songs, apps, etc.  there's an ID you can use for your iCloud account - the two can be different or the same. So which service are you referring to when you talk about an apple ID?

  • Can I sync two ipods with different ID on the same computer?

    can I sync two ipods with different ID on the same computer?

    Hi,
    Yes you can as long as you have two seperate user accounts on your computer. Hope this helps.
    xxmitchxx90

  • Can I sync two iPads with different users and email addresses on the same computer

    Can I sync two IPads with different users and email addresses on the same computer.

    yes, just make sure you turn off auto-sync to keep everything organized before you try syncing
    on a pc
    edit > preferences > devices - 'prevent ipads, iphones, and ipods from syncing automatically' needs to be checked

  • HT204053 I have two iphones with different numbers that I use my apple ID for purchases, etc.  How do I get my second iphone setup on icloud?  I would like to use the features of icloud for both of my iphones.  Thank you

    I have two iphones with different phone numbers that I use.  I have one of them set up on icloud now, but do not know how to set up my second device on icloud.  Both of my iphones use my same Apple ID for purchases, etc.  Is there a simple way to add a device to my icloud account?  Thank you in advance for any help someone may be able to give me.

    To move one of the phones to a different iCloud account (if that's what you want to do), go to Settings>iCloud and turn all synced data to Off.  When prompted, choose to keep the data on your iPhone.  After everything is off, scroll to the bottom and tap Delete Account.  This will delete the account from the phone but not from iCloud so the other phone will not be effected.  Then set up a new iCloud account with a different Apple ID and turn iCloud syncing in Settings>iCloud back to On.  When prompted, choose Merge.  This will upload the data to the new iCloud account.
    You will then have to go to icloud.com and sign into each iCloud account separately and delete any unwanted data that you don't want on the phone syncing with each account.

  • Can I backup two devices (with different documents) to one iCloud account?  For example: iPad and iPhone, not everything is synced between the two, but I would like to backup each (seperately in the cloud), is this possible?

    Hello Apple Community,
    Can I backup two devices (with different documents) to one iCloud account? 
    For example: iPad Air and iPhone 5, not everything is synced between the two, but I would like to backup each (seperately in the cloud).  Is this possible?
    This way when I change from an old ipad to a new, I can restore with the ipad backup, and when I change from an old iphone to a new, I can restore from the
    iphone backup.
    Thank you in advance!

    Terminology check here. Do you really mean a "CD"?  There's a difference in Cloud behavior between content from a physical CD you ripped (which only has Cloud content if you have iTunes Match) and an "album" you bought from the iTunes Store.
    Read references for Home Sharing.
    iTunes: How to share music and video - http://support.apple.com/kb/HT2688 - about Music Sharing and Home Sharing
    Home Sharing Support page - http://www.apple.com/support/homesharing/
    iOS: Setting up Home Sharing on your device - http://support.apple.com/kb/ht4557 - "With Home Sharing in iOS 4.3 or later, you can stream your entire iTunes library over your home Wi-Fi network from your Mac or PC right to your iPhone, iPad, or iPod touch."
    The above can get pretty complicated.  You are probably best off by syncing both devices to a single library and/or updating the libraries on both computers to have the same content.

  • I have 2? How do I sync selected photos from my IPad to my IMac w/o losing all photos on my IPad and getting the phoos o my IMac. ou see I have two IMacs with different sets of photos. Also want to convert all Apple works docs to pages docs on my IMac.

    I have 2? How do I sync selected photos from my IPad to my IMac w/o losing all photos on my IPad which will be replaced with the photos on my IMac.You see I have two IMacs with different sets of photos. Also want to convert all Apple works docs to pages docs on my IMac. Is there and app available to do the former. many thanks. b

    The iPad and related software is designed to sync with only one computer. I suggest transferring the photos from one of your iMacs to the other so that all photos are on one Mac. Same for all other files you want to sync over.
    To get those AppleWorks files to the iPad you'll have to determine if Pages will open them. If it will then use the file sharing feature of iTunes to copy them to Pages on your pad.
    If Pages will not open the AppleWorks files directly you'll have to save them in some format that Pages will read. These include but may not be limited to Pages and Word formats.

  • How can I setup an .indd with two columns with different threads so that I can export to epub?

    Hi all. Sorry, english is not my native language. I´ve made an .indd: each page has two columns with different threads (is a bilingual text). When I export this .indd to .epub only appears one column from a thread following the next thread. What can i do to fix this? My indesign is CS6
    Thank you

    There are fixed format EPUB files as can be used for children's books, etc. where there are a lot of illustrations. However, those are very work-intensive to produce. I've never worked on one.
    Anne-Marie Concepcion did a Lynda.com video on producing one.
    Rorohiko produces a product called ePubCrawler which can help in produced fixed format EPUB files:
    Fixed Layout EPUB Assistant In InDesign: ePubCrawler | Rorohiko ...

  • How do i run two threads with different sleep times?

    How do i run two threads with different sleep times?
    Ive got thread A and thread B, they both update a jpanel.
    They both start when i press the start button.
    However thread A updates every 250ms and thread B updates every 1000ms. i cant just run them both at 250ms becuase this will mess it up.
    So for every four runs of thread A i want thread b to only be run once
    Does anyone know how to do this?
    Thanks, Ant...

    ok, ive done it but now i cant stop it!
    ive added buttons to start and stop, the start button works but the stop button doesnt. why doesnt "t.stop();" work?
        public void run() {
            while(t == Thread.currentThread()) {
                System.out.println("No " + t.getName());
                if (t.getName().equals("1")){
                    try {
                        t.sleep(1000); // in milliseconds
                    } catch (InterruptedException e) {}
                } else{
                    try {
                        t.sleep(250); // in milliseconds
                    } catch (InterruptedException e) {}
        }

  • How to compare two datetimes in BPEL?

    Hi, All,
    I need compare two datetimes in a switch activity, but can't find any function for it.
    My switch activity like this:
    case date1>date2:
    do something;
    otherwise:
    do something;
    There's no such function in "Date Functions" and can't find such function in xpath.
    BTY, there's no function to make a time duration(by minus one date from another?..so this back to the data compare issue ).
    Thanks.

    Hi,
    Logical function such as greater/less than function can be used to compare two dates as same as comapring two numbers.
    Ex: If your receive variables contains two data elements as date1 and date2 then you can use below format in switch condition.
    XpathXpression(date1) > XpathXpression(date2)
    hope it will help you.

  • Compare two string in different line in textarea

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
                        public TextCounterPanel() {
                        setBackground(Color.DARK_GRAY);
                        textInput = new JTextArea();
                        textInput.setBackground(Color.WHITE);
                        JPanel south = new JPanel();
                        south.setBackground(Color.DARK_GRAY);
                        south.setLayout( new GridLayout(4,1,2,2) );
                             JButton countButton = new JButton("Process the Text");
                             countButton.addActionListener( new ActionListener() {
                                  public void actionPerformed(ActionEvent evt) {
                                       processInput();
                             south.add(countButton);
                        lineCountLabel = new JLabel(" Number of lines:");
                        lineCountLabel.setBackground(Color.WHITE);
                        lineCountLabel.setForeground(Color.BLUE);
                        lineCountLabel.setOpaque(true);
                        south.add(lineCountLabel);
                        setLayout( new BorderLayout(2,2) );
                        setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
                        JScrollPane scroller = new JScrollPane( textInput );
                        add(scroller, BorderLayout.CENTER);
                        add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel
    How can I compare two string in different line in text area

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TextCounterPanel extends JPanel {
    private JTextArea textInput;
    private JLabel lineCountLabel;
    public TextCounterPanel() {
    setBackground(Color.DARK_GRAY);
    textInput = new JTextArea();
    textInput.setBackground(Color.WHITE);
    JPanel south = new JPanel();
    south.setBackground(Color.DARK_GRAY);
    south.setLayout( new GridLayout(4,1,2,2) );
    JButton countButton = new JButton("Process the Text");
    countButton.addActionListener( new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    processInput();
    south.add(countButton);
    lineCountLabel = new JLabel(" Number of lines:");
    lineCountLabel.setBackground(Color.WHITE);
    lineCountLabel.setForeground(Color.BLUE);
    lineCountLabel.setOpaque(true);
    south.add(lineCountLabel);
    setLayout( new BorderLayout(2,2) );
    setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
    JScrollPane scroller = new JScrollPane( textInput );
    add(scroller, BorderLayout.CENTER);
    add(south, BorderLayout.SOUTH);
    public void processInput() {
    String text,vin; // The user's input from the text area.
    text = textInput.getText();
    vin =text.substring(25,42);
    lineCountLabel.setText(" vin: " + vin);
    } // end class TextCounterPanel

  • Two tables with different filter values base on a analysis

    Hi guys,
    let assume that I have a analysis with columns : group_id and sales.
    Based on it I would like to create two tables : table1 where group_id =1 and table2 where group_id = 2.
    Is OBIEE capable of doing it?
    Regards,
    Slavi

    Hi Slavi,
    You can do that in single analysis, but you need to have the group_id column two times.
    That is, bring group_id_1, group_id_2 (same column), sales
    Now in table 1,
    bring group_id_1, sales
    Then in selection steps for group_id_1 -> Select Members -> Action choose keep only -> choose the filter value 1
    This will filter the table 1 with group_id 1
    In table2 bring group_id_2, sales
    Then do the same step for group_id_2 with value 2.
    now in same report you have two reports with different filter.
    If you want you can keep the same column name for both group_id columns, I just kept group_id_1, group_id_2 for easy reference.

Maybe you are looking for

  • Questions about updating linked .ai files

    I have two questions regarding linked images. (1) Sometimes when I make changes to an .ai file, the InDesign document will automatically update the image as soon as I save the changes in Illustrator. In other words, I do not need to update the link i

  • Document rendering for print shows degraded resolution

    Hi all, I have printed for years with no problem, but now the rendering looks like a bad fax. I scanned a document at high resolution, creating a 7.7 MB file. I copied this file to my G3/266 running Mac OS 9.1, and opened it using Acrobat Reader 4.0,

  • I cannot find the command/template to force rebuild of users Spotlight

    I give up, I have searched these forums, but cannot find it. I need the command line to recreate the template, I know I found it online but cannot find it now. What's worse I had a template for it, but re imaged the Mac on which I run ARD, and cannot

  • Audio don't work and lighted red light

    I am having a problem that is leaving worried me. Mine iMac MC309BZ/A, simply stopped to function the sound. I verified and the red light is lighted in the output of audio. The stranger is that, aproximadamente the 7 hours before, I assisted a film a

  • Epson 1200U scanner

    Just getting my new iMac up and running. Anyone know if my old Epson 1200U Perfection will work with Snow Leopard? I tried it with Epson software that I've been using in my old eMac with 10.4.11 but no go. Am I scannerless now? Will the 1200U have to