|
|
|
|
 |
|  |
 |
cato |
| [cultura informatica] Epoch |
31-03-2005 16:06 |
|
 |
cato |
Wild boys always shine

Registered: Nov 2001
Posts: 5608 (0.63 al dì)
Location: lecco
Corso: F28
Anno: dottore
Time Online: 38 Days, 5:42:41 [...]
Status: Offline
Edit | Report | IP: Logged |
[cultura informatica] Epoch
perche per windows epoch è il 1601 e per unix il 1970?
se devo convertire l'ephoc di windows in unix
code:
//gettimeofday
#include <sys/time.h>
#include <windows.h>
//prototipo
int gettimeofday(struct timeval *tp, void *tzp);
int gettimeofday(struct timeval* tp, void* tzp){
union {
/*tempo passato dal 1 Gennaio 1601 (in centinaia di nanosec) */
long long ns100;
FILETIME ft;
} _now;
GetSystemTimeAsFileTime( &(_now.ft) );
//microsecondi
tp->tv_usec=(long)((_now.ns100 / 10LL) % 1000000LL );
//secondi dal 1 gennaio 1970
tp->tv_sec= (long)((_now.ns100-(116444736000000000LL))/10000000LL);
return (0);
}
è giusto,grazie?
__________________
code: , , | | Me@Flickr
[ov0] | | my photo Blog
{| |} |@| Pallavolo La Nuova Rossa Milano
--"-"--| |
-------| | "If You Can't Open It, You Don't Own It"
|
|
31-03-2005 16:06 |
|
|
|  |
 |
cato |
| uffa , ero curioso.... ... |
04-04-2005 10:42 |
|
 |
cato |
Wild boys always shine

Registered: Nov 2001
Posts: 5608 (0.63 al dì)
Location: lecco
Corso: F28
Anno: dottore
Time Online: 38 Days, 5:42:41 [...]
Status: Offline
Edit | Report | IP: Logged |
uffa , ero curioso....
__________________
code: , , | | Me@Flickr
[ov0] | | my photo Blog
{| |} |@| Pallavolo La Nuova Rossa Milano
--"-"--| |
-------| | "If You Can't Open It, You Don't Own It"
|
|
04-04-2005 10:42 |
|
|
|  |
 |
| All times are GMT. The time now is 13:30. |
|
|
 |
|
 |
|
|
|  |
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|