Extract hours and minutes

Hi,

I want the output like this.
For eg:
current time is 15:19
i need output like 15:21((System.DateTime.Now. AddMinutes(+2).ToShortTimeString)
with the syntax i got expected output
data type is string .but unable to get only hours and minutes.
expected output like : 15
21
Please help …

@vaish If you want to get the Hour Value and Minutes Value Separately then try this :

System.DateTime.Now. AddMinutes(+2).ToString(“HH”)

System.DateTime.Now. AddMinutes(+2).ToString(“mm”)

3 Likes

Hi,

Yeah i got the expected output…
Thanks

1 Like

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