xslt - subtracting days

前端 未结 5 1920
醉话见心
醉话见心 2020-12-15 09:26

Is it possible with xslt to take a date field and subtract N number of days from it? If so, can you please provide me an example?

5条回答
  •  生来不讨喜
    2020-12-15 10:23

    I can see that all the mentioned solutions are for XSLT 2.0. I have similar solution for XSLT 1.0 using EXSLT date:add

    Example: Consider that the number of days to be subtracted is 365 and we need it as the default start date. In this case, we have to provide the duration 365 days in xs:dayTimeDuration format i.e. '-P365D'.

    Please find below the code.

    
    
    
    
        
          
          
        
    
    

提交回复
热议问题