Bug #50754 Use int for timestamp field

Submitted: 30 Jan 2010 10:12 Modified: 1 Feb 2010 8:46
Reporter: Olaf van der Spek (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:* OS:Any
Assigned to: CPU Architecture:Any
Tags: qc

[30 Jan 2010 10:12] Olaf van der Spek
Description:
Timestamps fields are formatted on I/O. This is kinda unusable in C or PHP. Could an option be added to transfer timestamp fields as ints?

How to repeat:
-
[30 Jan 2010 11:11] Valeriy Kravchuk
Sounds like a feature request. Why severity S3 then?
[30 Jan 2010 11:13] Olaf van der Spek
It's more like a bug in the design than a new feature. But yeah, feature request might be more appropriate technically.
[28 Oct 2020 19:40] Bob Terrell
Just going to throw it out there that this bug has been open for *10 years*, and there's *still* no way to directly insert a timestamp into a TIMESTAMP column.

You're stuck converting the timestamp into a datetime with FROM_UNIXTIME(), and if you don't want daylight saving time screwing up the conversion back and forth (which is at least half the point of using the column), you need to explicitly set the time zone. If you started with a timestamp, though, this either means several queries to get the existing time zone, set it to +00:00, and then set it back, or manipulate the timestamp in an external language.

Either way, let's reiterate the absurdity that you can't put a TIMESTAMP in a TIMESTAMP column.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.