Questions tagged [timestamp]

A timestamp is the time at which an event is recorded by a computer system. The timestamp term may also refer to Unix Time or to the timestamp data type.

A timestamp is a sequence of characters, denoting the date and/or time at which a certain event occurred. A timestamp is the time at which an event is recorded by a computer, not the time of the event itself. In many cases, the difference may be inconsequential: the time at which an event is recorded by a timestamp (e.g., entered into a log file) should be very, very close to the time of the occurrence of the event recorded.

In some cases, a timestamp can be just the numbering of events, the use of a date_time format to store a timestamp is then not mandatory.

This data is usually presented in a consistent format, allowing for easy comparison of two different records and tracking progress over time; the practice of recording timestamps in a consistent manner along with the actual data is called timestamping.

Timestamps are typically used for logging events, in which case each event in a log is marked with a timestamp. In filesystems, timestamp may mean the stored date/time of creation or modification of a file.


Examples of timestamps

  • 2005-10-30 T 10:45 UTC
  • 2007-11-09 T 11:20 UTC
  • Sat Jul 23 02:16:57 2005
  • 1256953732

Standardization

ISO 8601 standardizes the representation of dates and times. These standard representations are often used to construct timestamp values.


References

13570 questions
4
votes
2 answers

Java Timestamp Comparison

I have a Timestamp being passed from an external source to my application in the 2011-01-23-12.31.45 format. I need to compare it to the current system timestamp an make sure its less than 2 minutes difference. Any ideas on how to accomplish this?
c12
  • 9,557
  • 48
  • 157
  • 253
4
votes
1 answer

Kafka message timestamps for request/response

I am building a performance monitoring tool which works in a cluster with Kafka topics. For example, I am monitoring two topics: request, response. I.e. I need to have two timestamps - one from request and another from response. Then I could…
kan
  • 28,279
  • 7
  • 71
  • 101
4
votes
1 answer

Is a java long enough to store epoch time in microseconds?

Can I use a java long to store with reasonable precision the epoch time in microseconds with out any special signed to unsigned conversion tricks? If so how would I calculate the end date range? This is the usual 8 byte date…
simgineer
  • 1,754
  • 2
  • 22
  • 49
4
votes
1 answer

Making sense of 'event_timestamp' numbers

I want to find the exact time stamp for an event but the numbers in the 'event_timestamp' column doesn't seem to make sense: I've been googling for some days now and I can't seem to find an answer to my problem. It's making me think if I'm asking…
4
votes
2 answers

time.Parse in Go with varying fractional second length

I am parsing a timestamp from a DB. My layout is the following: layout = "2006-01-02 15:04:05.000000000 -0700 MST" pipelineTS, err := time.Parse(layout, rawPipelineTS) The issue is that sometimes the fractional seconds are not 9 digits, for…
MarekT
  • 104
  • 8
4
votes
2 answers

Interpret timestamp fields in Spark while reading json

I am trying to read a pretty printed json which has time fields in it. I want to interpret the timestamps columns as timestamp fields while reading the json itself. However, it's still reading them as string when I printSchema E.g. Input json file…
van_d39
  • 725
  • 2
  • 14
  • 28
4
votes
2 answers

Extract month data from pandas Dataframe

I originally have dates in string format. I want to extract the month as a number from these dates. df = pd.DataFrame({'Date':['2011/11/2', '2011/12/20', '2011/8/16']}) I convert them to a pandas datetime object. df['Date'] =…
Bazman
  • 2,058
  • 9
  • 45
  • 65
4
votes
1 answer

Adding seconds with Carbon

The idea is that I need to get end_date from the Auction via this model, which is inside a database, in MySQL timestamp format (I use phpmyadmin, if it matters, ex. 2018-11-14 04:58:07). So when I get the end_date, the idea is to increment it by few…
skyhunter96
  • 135
  • 2
  • 2
  • 13
4
votes
2 answers

Javascript Timestamp from ISO8061

I'm having a bit of an issue when dealing with getting a timestamp from an iso8061 date. For some reason it work perfectly in Chrome, but causes an Invalid Date error in Firefox. The exact line is: var date = new…
Angelo R.
  • 2,285
  • 1
  • 17
  • 22
4
votes
1 answer

Can get timestamp of frame in video with pyav - python

How can I get timestamp of a frame in a video or rtmp stream from pts and time_base or duration? Thanks a lot! import av def init_input(file_name): global a container = av.open(file_name) a = container.duration return…
Thanh Nguyen
  • 41
  • 1
  • 2
4
votes
2 answers

Get the average date from multiple dates - pandas

DataFrame where Date is datetime: Column | Date :-----------|----------------------: A | 2018-08-05 17:06:01 A | 2018-08-05 17:06:02 A | 2018-08-05 17:06:03 B | 2018-08-05…
humanlearning
  • 61
  • 1
  • 1
  • 3
4
votes
2 answers

How to use Timestamp in a Map as key

I am working on a coding challenge on a banking application where I need to fetch number of transactions in last 60 seconds. For that I am using java.sql.Timestamp as a key of a map like below: Map> transactions1 = new…
J. Doe
  • 81
  • 2
  • 3
4
votes
1 answer

Laravel make merged created_at and updated_at timestamps

In a model I have created custom timestamps: const CREATED_AT = 'fil_ts'; const UPDATED_AT = 'fil_ts'; Basically the idea is that CREATED_AT timestamp will get updated whenever record is changed (in other words: I would have just one timestamp…
Tinabot
  • 399
  • 1
  • 4
  • 14
4
votes
2 answers

Compare timestamp to date

I need to compare a timestamp to a date. I would just like to compare the date portion without the time bit. I need to check whether a timestamp occurs on the day before yesterday i.e. today - 2. Could you show me a snippet please? Thank you. I've…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
4
votes
4 answers

MYSQL: Convert Timestamp --> Time

I have this MYSQL Table: [ID] [TIMESTAMP] [TIME] [1] [2010-05-29 01:17:35] [] [1] [2010-05-29 01:23:42] [] ... and so on Now I need to copy the TIMESTAMP value into the TIME rows. The new TIME rows are created via the PHP command time(); Problem: I…
user606346
  • 157
  • 1
  • 2
  • 9