Click here to Skip to main content
15,913,159 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Programming Question of the Week? Pin
Mark_Wallace8-Feb-19 9:28
Mark_Wallace8-Feb-19 9:28 
AnswerRe: Programming Question of the Week? Pin
CPallini8-Feb-19 2:36
mveCPallini8-Feb-19 2:36 
GeneralWSO CCC OTD 2019-02-08 Pin
OriginalGriff7-Feb-19 22:03
mveOriginalGriff7-Feb-19 22:03 
GeneralRe: WSO CCC OTD 2019-02-08 Pin
Tim Deveaux7-Feb-19 22:30
Tim Deveaux7-Feb-19 22:30 
GeneralRe: WSO CCC OTD 2019-02-08 - we have a winner! Pin
OriginalGriff7-Feb-19 22:43
mveOriginalGriff7-Feb-19 22:43 
GeneralRe: WSO CCC OTD 2019-02-08 - we have a winner! Pin
Tim Deveaux7-Feb-19 22:48
Tim Deveaux7-Feb-19 22:48 
GeneralRe: WSO CCC OTD 2019-02-08 - we have a winner! Pin
Richard Deeming8-Feb-19 1:25
mveRichard Deeming8-Feb-19 1:25 
GeneralFILETIME versus time_t - BIG FACEPALM Pin
Nelek7-Feb-19 21:10
protectorNelek7-Feb-19 21:10 
I know, it is the lounge... but I am not asking a programming question. It is more a philosophical one.

FILETIME = Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

time_t / Unix Timestamp = the number of seconds from Jan 1, 1970 (UTC)

I have found a lot of places using the same transformation rule where the offset is done by 116444736000000000LL which is exactly 369 years * 365 days * 24 hours * 3600 seconds * 10000000 (in 100 ns blocks)

But... what happens with leap years?

Thoughts?

(And before someone comes with the unnecessary commentary... yes, I am going to test it. This is just for the fun of a debate)


EDIT: My own shame, but to be fear I have to point to CPallinis answer below and copy my disclaimer / superlative facepalm here to avoid time waste for future readers...
Quote:
D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh:

I did the calculations with the windows calculator ...

in programmer mode. Which means no decimals
116444736000000000 / 1000 / 3600 / 24 / 365 = 369
and not 369,24383561643835616438356164383562 (the right answer)

D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh: D'Oh! | :doh:

I need Java | [Coffee] Java | [Coffee] Java | [Coffee] Java | [Coffee] Java | [Coffee] Java | [Coffee] Java | [Coffee]

M.D.V. Wink | ;)

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.


modified 8-Feb-19 4:21am.

GeneralRe: FILETIME versus time_t Pin
OriginalGriff7-Feb-19 21:22
mveOriginalGriff7-Feb-19 21:22 
GeneralRe: FILETIME versus time_t Pin
Jörgen Andersson7-Feb-19 21:58
professionalJörgen Andersson7-Feb-19 21:58 
GeneralRe: FILETIME versus time_t Pin
RugbyLeague8-Feb-19 0:31
RugbyLeague8-Feb-19 0:31 
GeneralRe: FILETIME versus time_t Pin
CPallini7-Feb-19 21:26
mveCPallini7-Feb-19 21:26 
GeneralRe: FILETIME versus time_t Pin
Nelek7-Feb-19 22:07
protectorNelek7-Feb-19 22:07 
GeneralRe: FILETIME versus time_t Pin
CPallini7-Feb-19 21:55
mveCPallini7-Feb-19 21:55 
GeneralRe: FILETIME versus time_t Pin
Nelek7-Feb-19 22:15
protectorNelek7-Feb-19 22:15 
GeneralRe: FILETIME versus time_t Pin
Rage8-Feb-19 1:15
professionalRage8-Feb-19 1:15 
GeneralRe: FILETIME versus time_t Pin
Nelek8-Feb-19 1:18
protectorNelek8-Feb-19 1:18 
GeneralRe: FILETIME versus time_t Pin
CPallini8-Feb-19 2:31
mveCPallini8-Feb-19 2:31 
GeneralRe: FILETIME versus time_t Pin
Nelek8-Feb-19 5:03
protectorNelek8-Feb-19 5:03 
GeneralRe: FILETIME versus time_t Pin
CPallini8-Feb-19 9:48
mveCPallini8-Feb-19 9:48 
GeneralRe: FILETIME versus time_t Pin
Jörgen Andersson7-Feb-19 21:56
professionalJörgen Andersson7-Feb-19 21:56 
GeneralRe: FILETIME versus time_t Pin
OriginalGriff7-Feb-19 22:05
mveOriginalGriff7-Feb-19 22:05 
GeneralRe: FILETIME versus time_t - BIG FACEPALM Pin
CodeWraith7-Feb-19 22:51
CodeWraith7-Feb-19 22:51 
GeneralRe: FILETIME versus time_t - BIG FACEPALM Pin
jsc427-Feb-19 23:03
professionaljsc427-Feb-19 23:03 
GeneralRe: FILETIME versus time_t - BIG FACEPALM Pin
CodeWraith7-Feb-19 23:14
CodeWraith7-Feb-19 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.