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
1 answer

Submit timestamp to mysql database with php mysqli

I have this database (mysql): And I have code: $day = $app->request->post('day'); $startLocation = $app->request->post('startLocation'); $datum = new DateTime(); $startTime = $datum->getTimestamp(); //this line…
LaraBeginer
  • 169
  • 1
  • 3
  • 15
4
votes
4 answers

SQL Server: Clustering by timestamp; pros/cons

I have a table in SQL Server, where i want inserts to be added to the end of the table (as opposed to a clustering key that would cause them to be inserted in the middle). This means I want the table clustered by some column that will constantly…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
4
votes
4 answers

Javascript function: Has half a second passed since last time you tried?

I'd like to build a function that returns false if it's been called less that half a second ago. timething.timechill=function(){ var last if (last){ if ((now.getTime()-last)>500){ return true } …
heorling
  • 339
  • 6
  • 17
4
votes
4 answers

Error Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] while saving timestamp into databse

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("US/Eastern")); String DateToStoreInDataBase=…
tom
  • 5,114
  • 6
  • 24
  • 36
4
votes
0 answers

Can't generate creation and update timestamps using @CreationTimestamp and @UpdateTimeStamp annotations

I'm trying to generate creation and update timestamps and as per this jboss link I have the following code inside my Hibernate model file: @CreationTimestamp @Column(name = "create_date") private Date createDate; @UpdateTimestamp @Column(name =…
Alex
  • 75
  • 1
  • 6
4
votes
1 answer

Check if timestamp is within tsrange

Is it possible to construct an on-the-fly tsrange and check if a value is within that? I have a table that has two fields, session_start and session_end and I want to run a query that checks if a passed value is between those two values. Something…
Christian P.
  • 4,784
  • 7
  • 53
  • 70
4
votes
3 answers

Why does the minus operator give different result than the TIMESTAMPDIFF() function in mysql?

Since TIMESTAMP in mysql is stored as a 32bit value representing the time interval from 1970-jan-1 0:00:00 in seconds, I assumed that using minus (-) operator on TIMESTAMP values would give the difference of these values in seconds. Actually…
f3r3nc
  • 620
  • 7
  • 15
4
votes
2 answers

Extract year and month from timestamp(6)

I have database, where i have inserted timestamps(6) in this format : 18-AUG-14 02.49.27.000000000 PM . I want to extract it into this: 2014-08 Its called ISO 8601
Martin Kóňa
  • 151
  • 2
  • 4
  • 12
4
votes
2 answers

Bash convert date to timestamp

I have a date in format 'YYYYMMDDHHMMSS' and I need to convert it to Unix timestamp. I tried to date -d '20140826225834' but I get 'invalid date' error. I asume that I would have to convert what I have ( 20140826225834 ) to accepted date and then…
Lenny
  • 887
  • 1
  • 11
  • 32
4
votes
1 answer

Freemarker get current timestamp

How can I get the current timestamp (number of seconds since 01/01/1970) in a freemarker file? I know the .now var but I didn't figure how to get a basic timestamp format.
Julien
  • 2,616
  • 1
  • 30
  • 43
4
votes
2 answers

ElasticSearch Get Time in Groovy Script

My application is using this script for boosting more recent items in the index: (5 / ((3.16*pow(10,-11)) * abs(time() - doc[\'date\'].date.getMillis()) + 0.2)) + 1.0 It's written in MVEL, but as of 1.3, MVEL is deprecated for Groovy. The script…
Jonah
  • 9,991
  • 5
  • 45
  • 79
4
votes
2 answers

Unix Timestamp Conversion PHP - Wrong Date

I'm trying to do something incredibly simple - convert a timestamp to a string in php with the date() function. Code is as follows: $test = date('d/m/y','1407974400000'); echo $test; I expect the answer to be 14/8/14. If I check on…
4
votes
1 answer

Is there any way to find the time stamp (creation time) from a GUID?

I assume when we create a GUID, it encodes a time-stamp. Is there any way I can find the time stamp from a GUID? Thanks in advance,
4
votes
1 answer

Windows Time Stamp format (type of MOUSEMOVEPOINT return value)

I am using the native method GetMouseMovePointsEx (pinvoke.net, MSDN). Refer to my related question: GetMouseMovePointsEx: Bounds / MOUSEMOVEPOINT in (mp_in) problems. Because this function only returns new data when the cursor is moved, I need a…
Scott Solmer
  • 3,871
  • 6
  • 44
  • 72
4
votes
2 answers

Is timestamp (with different timezone formats) in future?

I am given timestamps formatted like this: Mon Jul 28 11:39:29 GMT-05:00 2014 Mon Jul 28 13:39:29 GMT+02:00 2014 Thu Jul 17 00:02:02 UTC 2014 Fri Jul 18 14:47:01 UTC 2014 I need to add X minutes to that and return true/false if the result is in the…
Pepster K.
  • 339
  • 2
  • 5
  • 17