converting current time to seconds

Hello is there an easy way to convert the current time to seconds in  For example if the time was 2:30 pm the seconds would be 52200, i can do this easly with a few calculations using military time in, I was just wondering if there is a simple function i can use?
Who is Participating?
Yep - this is simple -

Dim intTotalSeconds as Integer
intTotalSeconds = DateTime.Now.TimeOfDay.TotalSeconds

That's it!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.