How to get timestamp dynamically?

Here is the string 2022-11-21 19:32:15.162039+00:00

I want to get the timestamp 19:32:15 dynamically so even it is placed anywhere in the string still can be captured

Is there a way to do it?

TIA

Hi @joscares

give a try with

Regex.Match(strValue, "\d{2}:\d{2}:\d{2}").Value()

Regards!

1 Like

Hi,

Can you try the following?

System.Text.RegularExpressions.Regex.Match(yourString,"\b\d{2}:\d{2}:\d{2}\b").Value

Regards,

1 Like

Tnx for this it works!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.