Manish Partey
Manish Partey

Reputation: 21

Get day, month, year, hour, minutes and seconds in XSLT 3.0

In my XSLT file, I need to record the current timestamp on which I am hitting the backend database in below XML tags

               <DateTimeOrdered>
                    <Day>3</Day>
                    <Month>6</Month>
                    <Year>2022</Year>
                    <Hour24>7</Hour24>
                    <Minute>7</Minute>
                    <Second>7</Second>
                    <MilliSeconds>150</MilliSeconds>
                </DateTimeOrdered>

In C# it's very easy to achieve, can someone please suggest me how this can be achieved in the XSLT file?

Upvotes: 1

Views: 110

Answers (1)

Manish Partey
Manish Partey

Reputation: 21

I am able to find the solution.

In my Azure APIM Inbound policy, I want to post the current timestamp while hitting the backend URL.

So initially I have declared variables like below

enter image description here

Post that declaration I have used those variables like below

enter image description here

and at the end I used the variable like below

enter image description here

Upvotes: 1

Related Questions