System time in miliseconds

A

Alex

Hello,

I'm starting to spam this group..I need a function that is equal to
this function in JAVA:

System.currentTimeMillis();

that returns the difference, measured in milliseconds, between the
current time and midnight, January 1, 1970 UTC. (output is like this:
1141375007171 )
I used the function:

timeGetTime ();

but the output is 4476095..What shall I do?

Thx a lot,

Sashka
 
R

Rolf Magnus

Alex said:
Hello,

I'm starting to spam this group..I need a function that is equal to
this function in JAVA:

System.currentTimeMillis();

that returns the difference, measured in milliseconds, between the
current time and midnight, January 1, 1970 UTC. (output is like this:
1141375007171 )
I used the function:

timeGetTime ();

but the output is 4476095..What shall I do?

There is no standard C++ function that gives you what you want, so you have
to resort to system-specific functions. On POSIX systems, you can try the
function gettimeofday().
 
A

Aleksander Beluga

Alex said:
that returns the difference, measured in milliseconds, between the
current time and midnight, January 1, 1970 UTC. (output is like this:
1141375007171 )
I used the function:

timeGetTime ();

Try Boost.Datetime, it is not platform-binded. However, standard C++ (as
far as I saw 2005th draft) contains no utilities for such things.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top