I want to use a function to get either the number of seconds or milliseconds since midnight, it doesn't matter. Does anyone know of a function that would give me this?

call time() to get current time in seconds, then localtime() to get tm struct. Then change the hours, minutes and seconds to 0, then call mktime() to normalize it and get the size_t time you would get from time() function. The difference between the two size_t objects is the number of seconds since midnight that you want.

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.