It is strange that the documentation refers to "%S" as "Two digit seconds" in the DateTimeConverter but includes all the fractional seconds too. One way could be to stick a StringSearcher with regular expression "^[0-9]+" before the DateTimeConverter and it'll drop the decimals.
How about:
@int(@DateTimeFormat(@Value(datetime),%Y%m%d%H%M%S))
How about:
@int(@DateTimeFormat(@Value(datetime),%Y%m%d%H%M%S))
You'd have to be careful about the rare case of 59.9 seconds rounding up to an invalid 60 (Edit: not an issue with "int") and any 0 being dropped at the start if it's just a timestamp
You'd have to be careful about the rare case of 59.9 seconds rounding up to an invalid 60 (Edit: not an issue with "int") and any 0 being dropped at the start if it's just a timestamp
The int function truncates rather than rounds.
Hi @virtualcitymatt , alternatively, you can also use SubstringExtractor or @Substring function.
@Substring(@DateTimeNow(),0,14)
If you would like to round the datetime value, this expression would be possible.
@Substring(@DateTimeAdd(@DateTimeNow(),PT0.5S),0,14)
Hi @virtualcitymatt , alternatively, you can also use SubstringExtractor or @Substring function.
@Substring(@DateTimeNow(),0,14)
If you would like to round the datetime value, this expression would be possible.
@Substring(@DateTimeAdd(@DateTimeNow(),PT0.5S),0,14)
Thanks - yeah the substring approach was my work around but it seemed like I should have been able to Format it to drop the decimals. Ahh well - I've created an idea for it. It's not the first time I've had to do this.
https://community.safe.com/s/bridea/a0r4Q00000I0oS8QAJ/add-an-option-in-datetimeconverter-datetimeformat-to-specify-second-precision