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
25
votes
2 answers

BigQuery: convert epoch to TIMESTAMP

I'm trying to range-join two tables, like so SELECT * FROM main_table h INNER JOIN test.delay_pairs d ON d.interval_start_time_utc < h.visitStartTime AND h.visitStartTime < d.interval_end_time_utc where h.visitStartTime is an INT64…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
24
votes
2 answers

Convert an ISO date to seconds since epoch in linux bash

I have a date in the ISO format YYYY-MM-DDTHH:SS (e.g. 2014-02-14T12:30). I'd like to convert it in seconds since epoch using only the date command in linux bash. All the dates refer to UTC locale. I know that this question is easily eligible for…
Gianluca Ghettini
  • 11,129
  • 19
  • 93
  • 159
23
votes
3 answers

Convert Instant to microseconds from Epoch time

In Instant there are methods: toEpochMilli which converts this instant to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z getEpochSecond which gets the number of seconds from the Java epoch of 1970-01-01T00:00:00Z. Both of these…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
22
votes
4 answers

How to convert a date YYYY-MM-DD to epoch in PHP

As per title: how to convert a string date (YYYY-MM-DD) to epoch (seconds since 01-01-1970) in PHP
Gianluca Ghettini
  • 11,129
  • 19
  • 93
  • 159
21
votes
3 answers

Convert a NSDate to milliseconds epoch time

I need to be able to convert a date to a time stamp, an epoch in milliseconds. All I see online are for converting milliseconds to NSDate and not the other way round. Any help out there?
bakwarte
  • 317
  • 1
  • 2
  • 10
20
votes
1 answer

Change loss function dynamically during training in Keras, without recompiling other model properties like optimizer

Is it possible to set model.loss in a callback without re-compiling model.compile(...) after (since then the optimizer states are reset), and just recompiling model.loss, like for example: class NewCallback(Callback): def __init__(self): …
Horse
  • 361
  • 2
  • 6
20
votes
6 answers

oracle convert unix epoch time to date

The context is that there is an existing application in our product which generates and sends the EPOCH number to an existing oracle procedure & vice versa. It works in that procedure using something like this SELECT UTC_TO_DATE (1463533832) FROM…
Subhash Dike
  • 1,836
  • 1
  • 22
  • 37
20
votes
3 answers

Localizing Epoch Time with pytz in Python

Im working on converting epoch timestamps to dates in different timezones with pytz. What I am trying to do is create a DateTime object that accepts an Olson database timezone and an epoch time and returns a localized datetime object. Eventually I…
mobiusinversion
  • 343
  • 1
  • 6
  • 17
19
votes
3 answers

Why new Date(null) is returning this: Date 1970-01-01T00:00:00.000Z?

new Date(null) // Date 1970-01-01T00:00:00.000Z How come when I type new Date(null) in JavaScript console I'm gettingDate 1970-01-01T00:00:00.000Z?
Baikuntha
  • 211
  • 1
  • 2
  • 7
19
votes
4 answers

Convert datetime.datetime object to days since epoch in Python

I've got a pandas.Series object that might look like this: import pandas as pd myVar = pd.Series(["VLADIVOSTOK 690090", "MAHE", NaN, NaN, "VLADIVOSTOK 690090", "2000-07-01 00:00:00"]) myVar[5] is parsed as a datetime.datetime object when the data…
tblznbits
  • 6,602
  • 6
  • 36
  • 66
19
votes
4 answers

Hive from_unixtime for milliseconds

We have a timestamp epoch column (BIGINT) stored in Hive. We want to get Date 'yyyy-MM-dd' for this epoch. Problem is my epoch is in milliseconds e.g. 1409535303522. So select timestamp, from_unixtime(timestamp,'yyyy-MM-dd') gives wrong results for…
Sourabh Potnis
  • 1,431
  • 1
  • 17
  • 26
18
votes
2 answers

Epoch or iso8601 date format?

For passing times in JSON to/from a web API, why would I choose to use an ISO8601 string instead of simply the UTC epoch value? For example, both of these are the same: Epoch = 1511324473 iso8601 = 2017-11-22T04:21:13Z The epoch value is…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
17
votes
4 answers

Calculating Future Epoch Time in C#

I was able to find example code to get the current timestamp in Linux Epoch (Seconds since Midnight Jan 1st 1970), however I am having trouble finding an example as to how to calculate what the Epoch will be in the future, say for example 10 minutes…
UnkwnTech
  • 88,102
  • 65
  • 184
  • 229
17
votes
2 answers

Converting days since epoch to date

How can one convert a serial date number, representing the number of days since epoch (1970), to the corresponding date string? I have seen multiple posts showing how to go from string to date number, but I haven't been able to find any posts on how…
pault
  • 41,343
  • 15
  • 107
  • 149
17
votes
3 answers

Moment.js and Unix Epoch Conversion

I have a web service that is returning a date as the following string: /Date(1377907200000)/ I use MomentJS to parse this to a moment object. moment("/Date(1377907200000)/") => Fri Aug 30 2013 20:00:00 GMT-0400 All of that is fine. But when I call…
Robert Kaucher
  • 1,841
  • 3
  • 22
  • 44