Questions tagged [timestamp]
For questions about timestamp data types and/or recording a particular point in time.
318 questions
0
votes
1
answer
79
views
Postgresql giving different result when comparing timestamp with date in different time zone
When running the following query, I would expect it to give the same result independently of the session time zone but instead it gives different result depending on the session:
select '2025-09-22' &...
0
votes
1
answer
165
views
Convert Oracle date column to timestamp with time zone
How can I convert a Oracle DATE column to TIMESTAMP WITH TIME ZONE without losing the content of that column?
0
votes
0
answers
20
views
Store edit-commencement time or edit-posted time
In all my past projects, for the following reasons, I have always used the server.database.timestamp for datetime field values, at the moment the record (row) is inserted or updated on the server.
...
5
votes
2
answers
1k
views
How to retrieve data based on year to date in Postgres?
I'd like to retrieve data from "year to date" in my below query. I was hoping for something simple in the 'INTERVAL' but could not find anything.
I have the following:
SELECT
"...
0
votes
1
answer
89
views
How to change the timestamp format of percona mysql audit logs
I have a RHEL linux server where I have installed mysql percona and set the auditing.
The Queries received in the audit record has timestamp in below format.
{"audit_record":{"name"...
1
vote
1
answer
246
views
Alter timestamptz column to timestamp, without re-writing the table
I'm using Postgres Debezium source connectors, which does not support columns with timezone. I want to convert a table column from type from timestamptz to timestamp.
Postgres table stores data in UTC ...
0
votes
1
answer
58
views
Detect concurent objects based on category and timespan
I have a Postgres table with categorys and timespans (columns valid_from and valid_to).
This represents road sign that are installed for certain time span.
I want to compute how many road signs there ...
0
votes
1
answer
259
views
Postgres unexpected results with time zone conversions
I am doing some imports of data that includes time zone conversion. Data that I am importing is in America/New_York timezone and I have to import it as UTC timestamp.
I tried some examples I found on ...
3
votes
1
answer
1k
views
"#1292 - Incorrect datetime value" when time is within one hour
I'm running into a bizarre error with a timestamp column in a MySQL DB. When inserting the date/time value, it fails with a #1292 error if the time is between 02:00:00 and 02:59:59. Here is a sample ...
0
votes
1
answer
2k
views
Using dbeaver and postgresql can I declare a variable INTERVAL to pass into a sproc?
I have a PostgresSQL table that has a field for TIMESTAMP, and an associated stored procedure that takes an INTERVAL and calculates the difference from now() + in_interval. I want to use dbeaver to ...
0
votes
1
answer
67
views
Cannot make sense of timestamptz offset
Sample code:
show timezone;
TimeZone
---------------
Europe/Berlin
(1 row)
create table foo (ts timestamp without time zone);
insert into foo values ('2023-10-28 23:58:00');
insert into foo ...
1
vote
2
answers
1k
views
Can I get the created time of a PostgreSQL DB?
I'm using PostgreSQL-13.0.
Is there a way I can get the created time or last modified time of a database?
Thanks!
4
votes
1
answer
360
views
Postgres strange conversion of the string 'now' to timestamp
It looks like postgres treats the string 'now()' the same as a call to the now() function.
Why does postgres allow this?
select 'now'::timestamp;
or this?
select 'now()'::timestamp;
or even this?
...
0
votes
1
answer
565
views
In Snowflake, how do I include a timestamp in a result that has zero rows?
I have run a query in Snowflake that returns zero rows. How do I add a timestamp to a query that returns zero rows?
3
votes
1
answer
1k
views
In Snowflake, how do I CAST CURRENT_TIMESTAMP up to the minute only?
In Snowflake, how do I CAST CURRENT_TIMESTAMP up to the minute only. I don't want seconds, milliseconds, or timezone included in my result.