How to get number of secondes between two dates with XPath [duplicate]Finding the difference between two dateTimes in XSLTHow to calculate the XPath position of an element using Javascript?Getting attribute using XPathHow to check if a date falls between two other dates in XPathGet XPath of XML TagCalculating number of days from two dates in XML with XSLTbest way to transport messages between two different WSO2ESBWSO2 products performance in real timeHow to reserve property value between every task callHow can I get all the values of from a nested xml?In wso2 esb how to get a single number(integer) value

How to unit test methods which using static methods?

Does Latin have any neuter words for humans?

Prime parity peregrination

Checkmate in 1 on a Tangled Board

Using “ser” without "un/una"?

Why were the first airplanes "backwards"?

I hit a pipe with a mower and now it won't turn

Can European countries bypass the EU and make their own individual trade deal with the U.S.?

If two black hole event horizons overlap (touch) can they ever separate again?

Sharing referee/AE report online to point out a grievous error in refereeing

Word ending in "-ine" for rat-like

Why would anyone even use a Portkey?

Why wasn't EBCDIC designed with contiguous alphanumeric characters?

I just started should I accept a farewell lunch for a coworker I don't know?

How to securely dispose of a smartphone?

Was it really unprofessional of me to leave without asking for a raise first?

Is there reliable evidence that depleted uranium from the 1999 NATO bombing is causing cancer in Serbia?

What kind of jet plane is this?

Put my student loan in parents’ second mortgage - help?

Just graduated with a master’s degree, but I internalised nothing

Could human civilization live 150 years in a nuclear-powered aircraft carrier colony without resorting to mass killing/ cannibalism?

Security Patch SUPEE-11155 - Possible issues?

Should 私の be omitted?

Have any large aeroplanes been landed - safely and without damage - in locations that they could not be flown away from?



How to get number of secondes between two dates with XPath [duplicate]


Finding the difference between two dateTimes in XSLTHow to calculate the XPath position of an element using Javascript?Getting attribute using XPathHow to check if a date falls between two other dates in XPathGet XPath of XML TagCalculating number of days from two dates in XML with XSLTbest way to transport messages between two different WSO2ESBWSO2 products performance in real timeHow to reserve property value between every task callHow can I get all the values of from a nested xml?In wso2 esb how to get a single number(integer) value






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1
















This question already has an answer here:



  • Finding the difference between two dateTimes in XSLT

    4 answers



I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B.
Basically, i would like to calcul time between system time and 12.00pm.
Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only.
I am restricted with Xpath because i can't use a Java script.



Thank you.










share|improve this question













marked as duplicate by michael.hor257k xml
Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 26 at 8:57


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 2





    See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

    – michael.hor257k
    Mar 25 at 14:17











  • It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

    – Robyn.D
    Mar 26 at 8:41











  • This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

    – michael.hor257k
    Mar 26 at 8:56











  • Ophychius answer is more understandable for me, sorry if my question is a duplication.

    – Robyn.D
    Mar 26 at 13:01

















1
















This question already has an answer here:



  • Finding the difference between two dateTimes in XSLT

    4 answers



I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B.
Basically, i would like to calcul time between system time and 12.00pm.
Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only.
I am restricted with Xpath because i can't use a Java script.



Thank you.










share|improve this question













marked as duplicate by michael.hor257k xml
Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 26 at 8:57


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • 2





    See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

    – michael.hor257k
    Mar 25 at 14:17











  • It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

    – Robyn.D
    Mar 26 at 8:41











  • This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

    – michael.hor257k
    Mar 26 at 8:56











  • Ophychius answer is more understandable for me, sorry if my question is a duplication.

    – Robyn.D
    Mar 26 at 13:01













1












1








1









This question already has an answer here:



  • Finding the difference between two dateTimes in XSLT

    4 answers



I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B.
Basically, i would like to calcul time between system time and 12.00pm.
Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only.
I am restricted with Xpath because i can't use a Java script.



Thank you.










share|improve this question















This question already has an answer here:



  • Finding the difference between two dateTimes in XSLT

    4 answers



I am working with WSO2 ESB and i would like to know how can i get secondes betwenn date A and B.
Basically, i would like to calcul time between system time and 12.00pm.
Do you have any idea ? I found how to do get number of days but nothing for secondes with Xpath only.
I am restricted with Xpath because i can't use a Java script.



Thank you.





This question already has an answer here:



  • Finding the difference between two dateTimes in XSLT

    4 answers







xml xslt xpath wso2esb






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 14:08









Robyn.DRobyn.D

1211 silver badge12 bronze badges




1211 silver badge12 bronze badges




marked as duplicate by michael.hor257k xml
Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 26 at 8:57


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by michael.hor257k xml
Users with the  xml badge can single-handedly close xml questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 26 at 8:57


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 2





    See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

    – michael.hor257k
    Mar 25 at 14:17











  • It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

    – Robyn.D
    Mar 26 at 8:41











  • This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

    – michael.hor257k
    Mar 26 at 8:56











  • Ophychius answer is more understandable for me, sorry if my question is a duplication.

    – Robyn.D
    Mar 26 at 13:01












  • 2





    See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

    – michael.hor257k
    Mar 25 at 14:17











  • It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

    – Robyn.D
    Mar 26 at 8:41











  • This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

    – michael.hor257k
    Mar 26 at 8:56











  • Ophychius answer is more understandable for me, sorry if my question is a duplication.

    – Robyn.D
    Mar 26 at 13:01







2




2





See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

– michael.hor257k
Mar 25 at 14:17





See if this answers your question: stackoverflow.com/questions/38604414/… If not, add more details.

– michael.hor257k
Mar 25 at 14:17













It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

– Robyn.D
Mar 26 at 8:41





It gave me some interesting functions but not what i am looking for. Thank you for your time, Ophychius found what i was looking for

– Robyn.D
Mar 26 at 8:41













This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

– michael.hor257k
Mar 26 at 8:56





This answer there stackoverflow.com/a/38607378/3016153 is identical to the one you have accepted here.

– michael.hor257k
Mar 26 at 8:56













Ophychius answer is more understandable for me, sorry if my question is a duplication.

– Robyn.D
Mar 26 at 13:01





Ophychius answer is more understandable for me, sorry if my question is a duplication.

– Robyn.D
Mar 26 at 13:01












1 Answer
1






active

oldest

votes


















1














The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:



<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now" 
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>


<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>


Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.



#synapse.xpath.dom.failover.enabled=true


Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.






share|improve this answer























  • This is exactly what i am looking for. Thank you !

    – Robyn.D
    Mar 26 at 8:39














1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:



<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now" 
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>


<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>


Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.



#synapse.xpath.dom.failover.enabled=true


Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.






share|improve this answer























  • This is exactly what i am looking for. Thank you !

    – Robyn.D
    Mar 26 at 8:39















1














The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:



<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now" 
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>


<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>


Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.



#synapse.xpath.dom.failover.enabled=true


Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.






share|improve this answer























  • This is exactly what i am looking for. Thank you !

    – Robyn.D
    Mar 26 at 8:39













1












1








1







The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:



<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now" 
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>


<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>


Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.



#synapse.xpath.dom.failover.enabled=true


Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.






share|improve this answer













The basic is to turn both into proper xs:dateTime objects, then calculate the difference. This will give you a dayTimeDuration. Divide this by the dayTimeDuration of 1 second and you have your difference in seconds. Example:



<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="now" 
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T',get-property('SYSTEM_DATE', 'HH:mm:ss')) "/>
<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="12pm"
expression="concat(get-property('SYSTEM_DATE', 'yyyy-MM-dd'),'T12:00:00')"/>


<property xmlns:xs="http://www.w3.org/2001/XMLSchema" name="diff"
expression="xs:dayTimeDuration(xs:dateTime(syn:get-property('now'))-xs:dateTime(syn:get-property('12pm'))) div xs:dayTimeDuration('PT1S')"/>


Keep in mind you need to enable xpath 2.0 for this on the ESB/EI. You can do this by uncommenting the following line in your [WSO2CARBON_HOM]/repository/conf/synapse.properties file.



#synapse.xpath.dom.failover.enabled=true


Also keep in mind that once you have done that, xpath expression where you combine functions from synapse namespace (like get-property) with normal xpath functions will require the use of a prefix like in the code example.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 7:18









ophychiusophychius

2,0621 gold badge21 silver badges43 bronze badges




2,0621 gold badge21 silver badges43 bronze badges












  • This is exactly what i am looking for. Thank you !

    – Robyn.D
    Mar 26 at 8:39

















  • This is exactly what i am looking for. Thank you !

    – Robyn.D
    Mar 26 at 8:39
















This is exactly what i am looking for. Thank you !

– Robyn.D
Mar 26 at 8:39





This is exactly what i am looking for. Thank you !

– Robyn.D
Mar 26 at 8:39








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.





Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?