What is Epoch Time and How to convert this in human understandable format?
What is Epoch Time and How to convert this in human understandable format?
An epoch means an instant in time chosen as the origin of a particular era .The "epoch" then serves as a reference point from which time is measured. Time measurement units are counted from the epoch so that the date and time of events can be specified unambiguously.
Events taking place before the epoch can be dated by counting negatively from the epoch, though in pragmatic periodization practice, epochs are defined for the past, and another epoch is used to start the next era, therefore serving as the ending of the older preceding era. The whole purpose and criteria of such definitions is to clarify and co-ordinate scholarship about a period, at times, across disciplines.
Epochs are generally chosen to be convenient or significant by a consensus of the time scale's initial users, or by authoritarian fiat. The epoch moment or date is usually defined by a specific clear event, condition, or criteria— the epoch event or epoch criteria —from which the period or era or age is usually characterized or described.
In case of SEPM , the time is stored in the database is the time when this database record was entered or modified in the database, in milliseconds since 1970.
Now , the question is how should we convert this integer into human understandable form.
There are 2 ways in which we can do this:
1. Go to http://www.epochconverter.com/ and use the Epoch Converter. This converter will change the time stamp to human date. It can also do vice versa
2. We can query it from the database using either of the two
Creation_Time/1000, '1/1/1970 00:00')[Creation Time]
Or
time_stamp /86400000 + DATEADD (ms,time_stamp%86400000,'19700101') as 'Time Stamp'
Example:
SELECT computer_domain_name,computer_name,current_login_user,ip_addr1_text,dateadd(s, Last_scan_time/1000, '1/1/1970 00:00')[Last Scan Time]
FROM sem_agent
INNER JOIN v_sem_computer ON sem_agent.computer_id=v_sem_computer.computer_id
WHERE last_scan_time > '0'
OR
SELECT Computer_Name [Computer Name], dateadd(s, Creation_Time/1000, '1/1/1970 00:00')[Creation Time] from SEM_CLIENT
Comments
It would have been great, if I would have seen this article before :)
Tech Functions
Please check out this website (http://www.epochconverter.com/epoch/functions.php). It supports quick utility functions that you can clip and paste in your code (JavaScript, ASP and PHP samples are provided)
Thank you for the
Thank you for the information..
Please don't forget to mark your thread solved with whatever answer helped you : ) Thanks & Regards Aravind
It's zero or earlier. It is
It's zero or earlier.
It is as if the origin of axes. All we do relate to the initial point. It is a term that has its roots in mathematics and a lot to help us understand the evolution of things.
That is some thing new to
That is some thing new to me....Good info
Would you like to reply?
Login or Register to post your comment.