Follow via:
RSS
Email Alert
Question
0 Votes
+ -

How do I check if a time field is within 5 seconds of another in XSL?

I have an interface between two pieces of software with Stylesheets between to transform and also validate certain data. A requirement has been altered so that rather than just checking two fields are equal before selecting, I now require a test where they are equal or no more the 5 seconds greater?






If anyone has a solution to this I would love to know about it.

Thanks

Simon
5th Dec 2011

Answers (1)

0 Votes
+ -
What's your date/time format?
What's your time format? You could simply use substring function for both fields to get the seconds, then subtract them and check if they're < 5
Updated - 6th Dec 2011

Replies

Thanks for the update. Initially the field is a full Date:Time field YYYYMMDD HH:MM:SS

the issue is if the seconds are likely to be near the full minute i.e. 58 secs. As then the result will be wrong if just using greater than. I was hoping for a function where I could set a second variable that was based on the Date:Time given plus 5 seconds and then to a comparison?

Is this possible?

Thanks again for your response so far.

Simon
SimonP093 7th Dec 2011
Answer the question
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.