S
S
Socgrad2014-03-08 11:38:19
*nix-like systems
Socgrad, 2014-03-08 11:38:19

Incomprehensible Unix time format - what is it?

In one of the programs, an incomprehensible format for recording time was encountered.
For example, the date 01/29/2014 corresponds to such a label - 130354550430567734
It is unlikely that the creators tried to encode something, rather, some kind of logic was laid down.
Tell me, who will understand how to extract the date from this label.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Socgrad, 2014-03-08
@Socgrad

Found the answer in the documentation of the program. If this is useful to someone, here it is:
The date storage format accepted in TeamWox is a 64-bit timestamp and corresponds to the INT64 type in C++.
The date value represents the number of 100 nanosecond intervals since January 1, 1601.
In the Windows API, this value corresponds to the FILETIME structure, and API functions such as FileTimeToSystemTime, GetSystemTimeAsFileTime, and others are used to work with this constructor.
An example of a 64-bit timestamp conversion code that is used in TeamWox in JavaScript client scripts is as follows:
function TimeToInt64(utc)
{
utc = Math.ceil(utc/1000)+11644473600;
return(utc + "0000000");
}
function TimeFromInt64(i64time)
{
if(typeof(i64time)=="string")
{
i64time=parseInt(i64time.substr(0,i64time.length-7));
if(isNaN(i64time))
return(null);
}
else
i64time/=10000000;
//---
return new Date((i64time - 11644473600)*1000);
}

V
Vit, 2014-03-08
@fornit1917

number of seconds (in your case milliseconds) since January 1, 1970
en.wikipedia.org/wiki/UNIX-%D0%B2%D1%80%D0%B5%D0%B...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question