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
4 answers

Removing delimiters from a date/time string

I want to take this Code: 2010-12-21 20:00:00 and make it look like this: Code: 20101221200000 This is the last thing I tried Code: #!/usr/bin/perl -w use strict; my ($teststring) = '2010-12-21 20:00:00'; my $result = " "; print…
Nate the Noob
  • 370
  • 2
  • 5
  • 16
4
votes
2 answers

PL SQL - Convert timestamp to datetime/date

select to_timestamp(SCHEDULED_TIME,'YYYY-MM-DD HH24:MI:SS.FF') as SCHEDULED_TIME, TRUNC(to_date(to_timestamp(SCHEDULED_TIME,'YYYY-MM-DD HH24:MI:SS.FF'),'YYYY-MM-DD HH24:MI:SS')) from S_TIDAL_STATUS The error was: ORA-01830: date format picture…
Anna Huang
  • 287
  • 2
  • 5
  • 15
4
votes
1 answer

Pyspark: Difference between two Dates (Cast TimestampType, Datediff)

There is a table with incidents and a specific timestamp. I struggle to calculate the number of days passed using the Pyspark 2.0 API. I managed to do the same thing when the timestamp followed another format (yyyy-mm-dd) …
Niklas Brauer
  • 67
  • 1
  • 2
  • 7
4
votes
1 answer

MySQL - ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value, on a Timestamp column

I have a MYSQL column that is defined as TIMESTAMP. Whenever I create a row with javascript new Date() the value is stored ok without issues. However when I want to update the value, sending the same new Date() on that column, i get an error Error:…
htafoya
  • 18,261
  • 11
  • 80
  • 104
4
votes
1 answer

Python timestamp (13 digits) to string returns 2074 year and how to convert 15 digits timestamp to string

so I'm using Instagram API and I need to get time when the picture was uploaded. Usually everything is fine and timestamp looks like this: >>> import time >>> timestamp = 1497423819748 >>> time.strftime("%d %b %Y %H:%M:%S GMT", time.gmtime(timestamp…
Ronny Strom
  • 43
  • 1
  • 8
4
votes
2 answers

MySQL: Is there a way to automatically set datetime field to record creation timestamp?

I know there is TIMESTAMP data type that automatically updates to timestamp value when a record is updated, and I already have such column. Besides that I'd like to have a column that automatically populates to NOW() (or CURRENT_TIMESTAMP) and never…
tishma
  • 1,855
  • 1
  • 21
  • 43
4
votes
1 answer

utc string to unix time conversion python

I have a list of UTC time stamps stored as string format as follows: '20170124T1815' Is there a function in python to convert these strings to unix time? I have tried: dt =…
coja7723
  • 43
  • 1
  • 5
4
votes
1 answer

Select last 7 days from unix timestamp mysql

I have never really messed with this type of query so I need some assistance. I have a table with a timestamp column that contains the following 1488693506 1488576676 1488575917 1487563577 1487563170 1487352348 1487352291 1487207322 I am using the…
Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81
4
votes
1 answer

Pandas timestamp difference in groupby transform

I have a dataframe with an integer index, session_id, event, and time_stamp that looks like this: In [41]: df = pd.DataFrame(data={'session_id': np.sort(np.random.choice(np.arange(3), 11)), 'event': np.random.choice(['A', 'B', 'C', 'D'], 11),…
lenderson
  • 135
  • 1
  • 5
4
votes
3 answers

Python compare timestamp to input time

I have some dataframe with timestamps as a column, I want to filter rows between 8:00:00 to 17:00:00 with np.where. I keep getting error messages on data/object types. Any help would be appreciated example: timestamp volume 2013-03-01 07:59:00 …
yusica
  • 255
  • 2
  • 5
  • 13
4
votes
1 answer

Converting String Date To Carbon Timestamp with Locale

I have a date in string format, "Mon, 13 Feb 2017 09:30:00 GMT". I am trying to cast it to Carbon timestamp but I couldn't manage how. How can I use the GMT? What is the proper way? $date = 'Mon, 13 Feb 2017 09:30:00…
senty
  • 12,385
  • 28
  • 130
  • 260
4
votes
0 answers

Android apk file components have incorrect timestamp

I am generating an android apk using gradle system from command line. Although the generated apk has correct timestamp(i.e modified time), apk components (for eg classes.dex) have wrong timestamp - Fri, Nov 30 1979 00:00:00. What can be the…
4
votes
1 answer

How does Postgresql round half-microseconds in timestamps?

I was under the impression that PostgreSQL rounded half-microseconds in timestamps to the nearest even microsecond. E.g.: > select '2000-01-01T00:00:00.0000585Z'::timestamptz; timestamptz ------------------------------- …
ifotneak
  • 41
  • 2
4
votes
2 answers

Is there a "local" timestamp?

I can convert from an UTC timestamp e.g. 1417392000 to a local datetime object including daylight saving time, but when I try and convert the local datetime object to a "local timestamp" then I get the same UTC timestamp as before. Am I thinking in…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
4
votes
1 answer

Remove BST and GMT from my data in R and just view the time

I am trying to find the timestamp in R so I used the anytime function as follows: Timestamp = anytime::anytime(paste(Date, Time)) but then I realise that the timestamp has BST and GMT. How can I get my timestamp without GMT or BST? Thank…
N.A.K
  • 35
  • 6