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

Strange behavior when updating timestamp column

There is MariaDB-10.3.18 table as: create table switching_log ( item_name varchar(20) NOT NULL, switched_off timestamp, switched_on timestamp ); select * from switching_log; +-----------+---------------------+---------------------+ |…
harp1814
  • 1,494
  • 3
  • 13
  • 31
4
votes
3 answers

How to get accurate UTC nanoseconds time stamp in Node.js

python3 has possibility running following construct: from datetime import datetime print({'timestamp':str(int(datetime.utcnow().timestamp() * (10**9)))}) That would output JSON-like structore: {'timestamp': '1567658264143923968'} Now I want to get…
xakepp35
  • 2,878
  • 7
  • 26
  • 54
4
votes
0 answers

why cp -p does not keep ctime

why cp -p does not keep ctime? I think all timestamps should be preserved as described --preserve[=ATTR_LIST] preserve the specified attributes (default: mode,ownership,timestamps), if possible additional attributes: context, links,…
L.SG
  • 121
  • 1
  • 5
4
votes
1 answer

How to access global.nativePerformanceNow() in react native production build? Or any other way to measure timestamps

I am trying to measure how long does it take for images to load in a react native app on my users' devices in different countries. In debug mode there is performance.now() that creates timestamp that I then send as a property of the event to…
4
votes
1 answer

Insert Instant datetime into MySql database with millisecond precision in java

I am using mysql 5.7.x version. Also i am using java 8. I am trying to insert java.time.instant current datetime in millisecond precision into my mysql database from java code. For that I am using preparedstatement. The table in my database…
Ujjwal Jung Thapa
  • 604
  • 2
  • 8
  • 31
4
votes
1 answer

php: current_timestamp for database field?

i'm trying to add a database field called "lastLogin" which should populate each time someone will log in. there's an error when trying to add the field: #1294 - Invalid ON UPDATE clause for 'lastLogin' column i'm not sure what's wrong - i'm…
Fuxi
  • 7,611
  • 25
  • 93
  • 139
4
votes
3 answers

php strtotime not working

so I converted this string to timestamp using strtotime: strtotime("1 Nov, 2001"); which results into the timestamp 1320177660 but then when I tried converted 1320177660 into a normal date format again using an online timestamp converter, the year…
kamikaze_pilot
  • 14,304
  • 35
  • 111
  • 171
4
votes
2 answers

Prometheus metrics with timestamp

When I query metrics from prometheus, I just get the timestamp when I queried. For example, If I query data like this, http://localhost:9090/api/v1/query?query=go_memstats_buck_hash_sys_bytes Then I got the response like following. { …
Jinho Yoo
  • 1,352
  • 5
  • 17
  • 28
4
votes
5 answers

Function to parse psql timestamp

I display the date or the time on my website a lot and I'm thinking about writing a function to parse a PostgreSQL timestamp. The timestamp is in the format: Y-m-d H:i:s.u. E.g. 2011-04-08 23:00:56.544. I'm thinking about something like…
PeeHaa
  • 71,436
  • 58
  • 190
  • 262
4
votes
1 answer

How to insert a value into SQLAlchemy TIMESTAMP column

I am trying to set value for timestamp column using SQLAlchemy, but I experience following error: column "timestamp" is of type timestamp without time zone but expression is of type numeric My table looks as folows: class SomeTable(db.Model): …
maslak
  • 1,115
  • 3
  • 8
  • 22
4
votes
1 answer

Convert column of epoch timestamps to datetime with timezone

I have a dataframe in my Jupyter notebook with a column of epoch timestamps, it looks like this: Name stop ts remark A 01 1546470653 - B 032 1546470969 Not listed C 022 1546471069 …
Steward
  • 297
  • 1
  • 3
  • 8
4
votes
2 answers

Create timestamp with fractional seconds

awk can generate a timestamp with strftime function, e.g. $ awk 'BEGIN {print strftime("%Y/%m/%d %H:%M:%S")}' 2019/03/26 08:50:42 But I need a timestamp with fractional seconds, ideally down to nanoseconds. gnu date can do this with the %N…
Rusty Lemur
  • 1,697
  • 1
  • 21
  • 54
4
votes
2 answers

Average timestamp in batch file

so in short my script currently outputs a csv with the log name, time stamp (10:38:52) and the message (Verification: SUCCESS and SendResponse: Response message). I now need for this script to be able to calculate and output the time difference…
user639410
  • 387
  • 1
  • 3
  • 9
4
votes
1 answer

How to map a Firestore date object to a date in elasticsearch

I am using a cloud function to send a Firebase firestore document to elasticsearch for indexing. I am trying to find a way to map a firebase timestamp field to an elasticsearch date field in the index. The elasticsearch date type mapping supports…
4
votes
1 answer

Manually convert PostgreSQL binary format of timestamp to integer

I've read that PostgreSQL internally stores timestamps as an 8-byte/64-bit integer. To check this I've created a table, inserted some timestamps and queried the heap_page_items. The output e.g. for timestamp 2019-01-08 09:00:00 was 00 e4 c2 56 …
user35934
  • 374
  • 2
  • 13