Questions tagged [epoch]

Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds. This tag is *not* for epochs as used in neural networks/machine learning.

Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds.

It is used widely, not only in Unix-like operating systems, but also in many other computing systems and file formats.

It is neither a linear representation of time nor a true representation of UTC (though it is frequently mistaken for both), as it cannot unambiguously represent UTC leap seconds (e.g. December 31, 1998 23:59:60), although otherwise the times it represents are UTC.

Unix time may be checked on some Unix systems by typing date +%s on the command line.

1440 questions
17
votes
11 answers

Convert Unix time with PowerShell

I am parsing an SQLite database using the PowerShell SQLite module, and a couple of the return values are created and modified, both of which are in Unix time. What I would like to do is somehow convert that into "human time". I have removed some of…
mrwh1t3
  • 349
  • 1
  • 4
  • 13
16
votes
2 answers

Can strict JSON $dates be used in a MongoDB query?

I'm trying to write a date comparison query using MongoDB's strict JSON representation of BSON. I'd like it to work in the MongoDB shell (v2.4.3) Here's what I've tried... Setup: create a new document with an at date of Jan 1, 2020 >…
Bosh
  • 8,138
  • 11
  • 51
  • 77
16
votes
1 answer

Javascript Epoch Time In Days

I need the epoch time in days. I've seen posts on how to translate it to date but none in days. I'm pretty bad with epoch time...how could I get this?
dman
  • 10,406
  • 18
  • 102
  • 201
15
votes
5 answers

Creating a unique timestamp in Java

I need to create a timestamp (in milliseconds) in Java that is guaranteed to be unique in that particular VM-instance. I.e. need some way to throttle the throughput of System.currentTimeMillis() so that it returns at most one results every ms. Any…
Yrlec
  • 3,401
  • 6
  • 39
  • 75
15
votes
6 answers

How to get seconds since epoch (1/1/1970) in VBA?

How can I get seconds since epoch (1/1/1970) in VBA?
aF.
  • 64,980
  • 43
  • 135
  • 198
15
votes
2 answers

Treat axis as date/time (epoch)

I'm generating a graph with gnuplot of activity over the last twenty four hours, but the time axis looks really bad because it's trying to fit the long number for every five minutes in the last day. Is there any way for gnuplot to treat the x-axis…
Jeffrey Aylesworth
  • 8,242
  • 9
  • 40
  • 57
15
votes
6 answers

Java time since the epoch

In Java, how can I print out the time since the epoch given in seconds and nanoseconds in the following format : java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); My input is: long mnSeconds; long mnNanoseconds; Where the total of the two is…
user1585643
  • 211
  • 1
  • 2
  • 9
14
votes
3 answers

Convert UNIX time (INT) to timestamp in BigQuery

I have a column "date_time" in a BigQuery table which contains unix timestamp values like "1569888224". The problem is that these values are integer data types, not timestamp data types, so I do not seem to have an easy way to convert them to human…
14
votes
3 answers

Why is the ColdFusion epoch time one hour behind the javascript epoch time?

I am writing an application where I need to get the epoch time on the server side using ColdFusion 8 running on Windows Server 2008 and client side using javascript (testing in Google Chrome). The problem is that the epoch time generated by…
SpasemanSpiph
  • 187
  • 1
  • 9
14
votes
2 answers

Convert unix epoch timestamp to TSQL datetime

I have found only one similar question but for MySQL. I was working on a web service and had to query the database (MS SQL server). Since I couldn't get the right result I decided to test the query via a SQL client. The web service uses Hibernate…
linski
  • 5,046
  • 3
  • 22
  • 35
13
votes
3 answers

What's the best way to get Epoch milliseconds in Perl?

It's easy to get Epoch-Seconds (timestamp) in perl: time But what's with milliseconds? The most effective way seems to be time*1000, but that's not as accurate as I want it to be. Any good hints except for the long terms documented @perldoc?
xsigndll
  • 513
  • 1
  • 5
  • 13
13
votes
0 answers

What happens after 2038-1-19?

Starting with the epoch time 1 January 1970 00:00:00 and counting to the limit a 32-bit signed integer can reach, the day when we reach the limit of counting time (in computer, of course) is 2038-1-19, as given in the answer by Matt Howells. a…
Sнаđошƒаӽ
  • 16,753
  • 12
  • 73
  • 90
13
votes
5 answers

subtracting two days from current date in epoch milliseconds java

I am trying to do something really simple. I am trying to subtract 2 days from the current day. I get the number of hours from the UI. So in this example, I get 48 hours from the UI. I am doing the following and I don't know what i'm doing wrong…
p0tta
  • 1,461
  • 6
  • 28
  • 49
13
votes
5 answers

In Python, is epoch time returned by time() always measured from Jan 1, 1970?

Is the epoch start time in Python independent of the platform (i.e. always 1/1/1970)? Or is it platform dependent? I want to serialize datetimes (with second accuracy) on various machines running Python, and be able to read them back on different…
kaalus
  • 4,475
  • 3
  • 29
  • 39
12
votes
3 answers

Converting time_t to int

I want to convert a given time into epoch(time_t) and vice versa. can anyone tell what is the routine or algorithm for this? Thanks Update epoch_strt.tm_sec = 0; epoch_strt.tm_min = 0; epoch_strt.tm_hour = 0; epoch_strt.tm_mday =…
Yogi
  • 1,035
  • 2
  • 13
  • 39