Native Datetime function returning wrong time - Anomaly

studio

#1

I have a strange issue and can’t seem to wrap my head around it.

I am trying to get a current time. But the time is showing as 00:00:00. But if you see my system time, its 2 PM. Quite strange. Any idea when can this happen?

Thanks,
Joshi


#2

@Joshikumarav, Try this

now.ToString("MM/dd/yyyy HH:mm:ss")

Regards,
Dom :slight_smile:


#3

Hi @Joshikumarav,

use Now.ToString() -> date with time
if you use Now.Date.Tostring will return only date.

Regards,
Arivu


#4

Both worked. Thanks a lot. I wanted just the time. I used this to get it with AM/PM:

Now.ToString(“h tt”)

image