Page 1 of 1

TimeStamp With Milliseconds & TimeZone

Posted: August 5th, 2020, 7:46 pm
by xavier
Hi,

Via a WebParser Measure I get a TimeStamp like this:

2020-08-05T15:33:33.014-0400

which I want to format so that I can discard the milliseconds BUT not the TimeZone.

So far:

TimeStampFormat=%Y-%m-%dT%H:%M:%S.

But I do not know how to "discard" the milliseconds and "get" the Timezone.

Any suggestions?

Re: TimeStamp With Milliseconds & TimeZone

Posted: August 5th, 2020, 8:03 pm
by balala
xavier wrote: August 5th, 2020, 7:46 pm But I do not know how to "discard" the milliseconds and "get" the Timezone.
Add a RegExpSubstitute=1 option to the WebParser measure returning the above time stamp, along with the following Substitute option: Substitute="(.*)T(.*)\.(.*)([-|\+].*)":"\1T\2\4".

Re: TimeStamp With Milliseconds & TimeZone

Posted: August 5th, 2020, 8:14 pm
by xavier
balala,

Fantastic!

Thanks :D

Re: TimeStamp With Milliseconds & TimeZone

Posted: August 5th, 2020, 8:17 pm
by balala
Glad to help.
Properly using regular expressions is not simple, but can help in many cases.