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
12
votes
3 answers

How to convert Pandas Timestamp into nano since Epoch?

What is the most efficient way to convert Pandas Timestamp into nano since Epoch? import pandas as pd ns = 1470924597871000000 timestamp = pd.to_datetime(ns, unit="ns") Then how to timestamp => 1470924597871000000 ns???
ChromeHearts
  • 1,693
  • 1
  • 17
  • 27
12
votes
2 answers

Convert epoch to date in sqlplus / Oracle

I have the following table: SQL> desc recording Name Null? Type -------------------- -------- ------ CAPTUREID NOT NULL NUMBER(9) STARTDATE NOT NULL DATE ENDDATE DATE STATE …
Oink
  • 123
  • 1
  • 1
  • 4
12
votes
4 answers

Convert Unix timestamp into datetime

I have the following data frame > head(try) creates time 1 128.29508 1417392072 3 236.98361 1417392072 7 98.45902 1417392072 9 157.44068 1417392131 10 227.38333 1417392131 11 242.03390 1417392131 > str(try) 'data.frame': 102968…
user3006691
  • 435
  • 3
  • 7
  • 16
11
votes
5 answers

mm/dd/yyyy format to epoch with PHP

I have a mysql table that relies on the unix epoch time stamp equivalent of the date of the entry to sort and filter in various parts of the website. I'm trying to implement a date picker that will enter the date into the form field in the…
matt
  • 113
  • 1
  • 1
  • 5
11
votes
2 answers

What happens to milliseconds since epoch when daylight savings time begins/ends?

Milliseconds since epoch represents the number of milliseconds that have elapsed since 1970. At the instant before daylight savings time ends, or when we set the clocks back to 1:00 from 2:00, do the milliseconds since epoch fall back as well, or…
vcapra1
  • 1,988
  • 3
  • 26
  • 45
10
votes
3 answers

Convert Epoch time to date and Date to Epoch time in Android

StrDate = "2011-07-19T18:23:20+0000"; How can I get an epoch time for the above date format in android also I would like to know how to convert a epoch time to the above date format. I would appreciate a direct answer with an example.
Ramji
  • 2,536
  • 7
  • 34
  • 54
10
votes
5 answers

Conversion from UNIX time to timestamp starting in January 1, 2000

I am trying to interact with an API that uses a timestamp that starts at a different time than UNIX epoch. It appears to start counting on 2000-01-01, but I'm not sure exactly how to do the conversion or what the name of this datetime format…
Tom Sitter
  • 1,082
  • 1
  • 10
  • 23
9
votes
3 answers

How to get the epoch time in SQL Server?

The scenario is this: select max date from some table, when the target table having no data, so the max date is null. when the date being null, I want to get the earliest date of system, so the epoch time seems perfect. I have searched some ways…
freeman
  • 399
  • 1
  • 3
  • 11
9
votes
4 answers

Convert Epoch time to human readable with specific timezone

To convert epoch dateTime to human readable , using a simple new date(1495159447834) will suffice. The problem I'm encountering now is that for my hybrid application, if the user set the time-zone in his phone date time setting to lets say GMT…
Gene
  • 2,178
  • 3
  • 30
  • 50
9
votes
2 answers

Is there a better way to convert from UTCTime to EpochTime?

I want to set a file's modification time to the time I got from exif data. To get the time from exif, I found : Graphics.Exif.getTag :: Exif -> String -> IO (Maybe String) To set the file modification time, I found : System.Posix.Files.setFileTimes…
David V.
  • 5,708
  • 3
  • 27
  • 27
9
votes
4 answers

Convert Date String into Epoch in Java

Is there a way to convert a given Date String into Milliseconds (Epoch Long format) in java? Example : I want to convert public static final String date = "04/28/2016"; into milliseconds (epoch).
Ashley
  • 441
  • 2
  • 8
  • 27
9
votes
1 answer

Get POSIX epoch as system_clock::time_point

I'm aware that the default value of a std::chrono::system_clock::time_point is the clock's epoch, but I can't find any mandate in the C++11 standard that system_clock's epoch is the same as the POSIX epoch (1970-01-01T00:00:00Z). Is it safe to…
Matt Kline
  • 10,149
  • 7
  • 50
  • 87
9
votes
3 answers

Converting Epoch to Date in Matlab

I have an array of Epoch milliseconds (array of numbers) in Matlab. I would like to convert these into UTC date-time format, such as DD-MM-YYYY HH:MM. Is there a pre-defined Matlab way to do this or will I have to write my own function?
Erol
  • 6,478
  • 5
  • 41
  • 55
9
votes
3 answers

python - datetime with timezone to epoch

In the code below, I am calculating now epoch and beginning of current day epoch. import time import pytz from datetime import datetime tz1 = pytz.timezone('CST6CDT') utc = pytz.timezone('UTC') now = pytz.UTC.localize(datetime.utcnow()) now_tz =…
t0x13
  • 351
  • 2
  • 10
  • 24
8
votes
2 answers

Python's `fromtimestamp` does a discrete jump

I am using datetime.fromtimestamp to convert epoch time into local time. I found that datetime.fromtimestamp does a discrete jump of one hour at a certain point of time and I am completely baffled as to why it does that. (I am also using time.mktime…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374