Monday, September 29, 2014

Example for subtracting time using xp20:subtract-dayTimeDuration-from-dateTime


We can use the  xp20:subtract-dayTimeDuration-from-dateTime(String1, String2) function to subtract  duration of String2 from String1 time.

For example:
         To subtract one day
              xp20:subtract-dayTimeDuration-from-dateTime(xp20:current-date(), 'P1D')

         To subtract  2 hours from the current date time 
             xp20:subtract-dayTimeDuration-from-dateTime(xp20:current-date(), 'PT2H')

        To subtract  one day 2 hours 
             xp20:subtract-dayTimeDuration-from-dateTime(xp20:current-date(), 'PD1DT2H')


The following example query adds a dayTimeDuration value equal to 1 day, 2 hours, 30 minutes, and 5 seconds to a date Time value equal to the date: January 1, 2003 and time: 1:00 AM as shown in the following query:
{
op:add-dayTimeDuration-to-dateTime(xs:dateTime("2003-01-01T01:00:00"), xf:dayTimeDuration("P1DT2H30M5S"))
}
The resulting date Time value equal to the date: January 2, 2003 and the time: 3:30:05 AM is returned as shown in the following result:
2003-01-02T03:30:05

Note:  The key observation here is that the format of String2,  if you don't have the time to be subtracted then just use  P, if you have time to be subtracted then user PT at the beginning.


Saturday, April 12, 2014

Is API Management = EPI

My boss asked me a question, "Is API Management going to rule over SOA?".  I had browsed through several sites and try to find out the details of API Management.  As usual, with the work API can't distinguish much.  Finally I made a list of comparisons and use cases to explain both of them (API Management and SOA) are not really rivals.   Both exist always and adds value at different levels to the organizations.

Now I have found a blog in SOA Thinkar  preferring "Enterprise API Management" in short EPM.  Its straight went into my mind not to confuse with popular API understanding.

I feel easy to understand and distinguish the modern API Management concept by calling them "Enterprise Programming Interface" in short EPM.

So I say  API Management = EPI.

Your thoughts are always welcome....