DateTime.UtcNow gets the system date and time,
so I was wondering if there is any function to extract only the syetem time and not the date.

If not just in case any one knows how to do that...
plz revert back...

Thanks in earnest...

Recommended Answers

All 5 Replies

Problem solved.

It just occured to me that i can extract the individual hrs, min and sec instances and concatenate them to get the actual system time.

Thanks again:)

well if any one knows any other way u can get back to me.

I am a little uncertain of what you wan't so I apologize if I am completly off the mark. But if you want the current time in ticks the actual datetime structure has a Ticks property you can use this in conjunction with DateTime.Now or DateTime.UtcNow so DateTime.UtcNow.Ticks ... Hope this helps

Thanks for reverting back.
But the .Ticks Property gives the number of ticks that represent the current date and time.
I am sorry but that was not exactly my question.

I want to extract the current system time (and not the date).
Let me Put it in another way...
I had a query like "whether there's any inbuilt function that can get the System Time.:)

You will have to use the interop services according to MSDN and the GetSystemTime function located in coredll.dll

Have you tried:

DateTime.Now.ToShortTimeString();
or
DateTime.Now.ToLongTimeString();

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.