how can convert current date to miliseconds from 1970(epoch actually)?

how can convert current date to miliseconds from 1970(epoch actually)?
Well, first you must find a function that returns the amount of seconds since the epoch. Then you can divide that number by 1000 to get the total amount of milliseconds. I hope this helps!
There isn't a portable way because different systems have different calls to get time with higher resolution than a second.

If you're using POSIX, call gettimeofday then convert the time_t part and tack on on the fractional part.

If you're using Window, call GetLocalTime then convert that.
Last edited on
Topic archived. No new replies allowed.