Number of seconds within current day

  • Thread starter Thread starter Marty
  • Start date Start date
M

Marty

Hi,

is there a variable in VB.NET that return the actual number of seconds
(or milliseconds) in the current day? Something like the variable Timer
in VB6?

I can calculate it, but I wanted to be sure if this var exist.

Thank you

Marty
 
Marty.
I would recommend the TimeSpan.TotalSeconds property.

You can use DateTime.TimeOfDay to get the time of a DateTime as a TimeSpan.

Something like:

Dim secondsOfDay As Double = DateTime.Now.TimeOfDay.TotalSeconds

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top