how to get the miliseconds before 1970?

P

PyongHopscotch

Hi all, I'm looking for a function that basically does localtime() or
loacltime_s() but can handle dates before 1970. Does anyone know of
some?

-Pyong
 
V

Victor Bazarov

Hi all, I'm looking for a function that basically does localtime() or
loacltime_s() but can handle dates before 1970. Does anyone know of
some?

I, for one, am not sure what you mean.

If the operating system can handle dates before 1970, why wouldn't you
use the OS-provided mechanism? If the OS *cannot* handle dates before
1970, how would 'localtime' function? To *get* the *local time* using
'localtime' before 1970 on an OS that doesn't handle time before 1970,
you would first have to somehow *set* the *local time* to some date
before 1970, no? See why I say that I am not sure what you mean?

V
 
J

Jens Theisen

Victor Bazarov said:
I, for one, am not sure what you mean.

He said he want something that's _basically_ localtime. So he just
looking for date library that can deal with historical dates.

I can't see how that was unclear.

Jens
 
V

Victor Bazarov

Jens said:
He said he want something that's _basically_ localtime. So he just
looking for date library that can deal with historical dates.

I can't see how that was unclear.

I always associated 'localtime' with time obtained from 'time' function.
I guess it should be possible to use 'localtime' with any value of type
'time_t', e.g. obtained from 'mktime' function. Is that what we are
talking about? So, if your standard library supports making 'time_t'
value from 'struct tm' that contains the date before 1970, then you could
use 'localtime' to convert that 'time_t' back, right?

I keep forgetting that some folks tend to ask "where to find blah?" here
instead of using Google (or any other search engines)... Go figure.

V
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top