Unable to get system time

Ask general questions here.
mohan.pentyala
Posts: 20
Joined: Thu Sep 20, 2018 7:43 am

Unable to get system time

Post by mohan.pentyala » Tue Nov 27, 2018 1:34 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4041
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to get system time

Post by odklizec » Tue Nov 27, 2018 2:28 pm

Hi,

Use "Now" instead of "Today". Today returns actual date and time 00:00:00. If you want actual time, you must use Now ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

mohan.pentyala
Posts: 20
Joined: Thu Sep 20, 2018 7:43 am

Re: Unable to get system time

Post by mohan.pentyala » Thu Nov 29, 2018 8:21 am

Thank you ,Its working