Page 1 of 1

Unable to get system time

Posted: Tue Nov 27, 2018 1:34 pm
by mohan.pentyala
Hi team,

I am trying to get system date and time, by using below code, but I am getting the only date not time. Can you please help me to get both date and time with seconds

timestamp = System.DateTime.Today.ToString("yy.MMM.dd_HHmmss");

Output :
18.Nov.27_000000

Re: Unable to get system time

Posted: Tue Nov 27, 2018 2:28 pm
by odklizec
Hi,

Use "Now" instead of "Today". Today returns actual date and time 00:00:00. If you want actual time, you must use Now ;)

Re: Unable to get system time

Posted: Thu Nov 29, 2018 8:21 am
by mohan.pentyala
Thank you ,Its working