---
title: "Timestamp"
type: "forum-thread"
url: "https://www.webforum.nu/amne/databaser-sql/112934-timestamp"
topic: "Databaser & SQL"
topic_url: "https://www.webforum.nu/amne/databaser-sql"
author: "AG"
published: "2004-10-04T21:52:01.000Z"
updated: "2004-10-06T19:53:12.000Z"
replies: 3
views: 371
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/databaser-sql/112934-timestamp"
---

# Timestamp

## #1 — AG, 2004-10-04T21:52Z

Läste följande om TIMESTAMP för MySQL när jag Googlade runt lite.

> A TIMESTAMP column is useful for recording the date and time of an INSERT or UPDATE operation because it is automatically set to the date and time of the most recent operation if you don't give it a value yourself. You can also set it to the current date and time by assigning it a NULL value.

Verkar kanon tänkte jag, att den automatiskt skulle lägga till datum/tid. Så jag gjorde en test. Men inte lade den till något per automatik, vad är felet?

Andreas

Permalänk: https://www.webforum.nu/p/112934

## #2 — @nders, 2004-10-05T06:05Z

Vad använder du för version av MySQL, samt vilken typ av databas använder du?

Följande går att läsa på www.mysql.com:

> Beginning with MySQL 4.1.1, the MySQL server can be run in MAXDB mode. When the server runs in this mode, TIMESTAMP is identical with DATETIME. That is, if the server is running in MAXDB mode at the time that a table is created, TIMESTAMP columns are created as DATETIME columns. As a result, such columns use DATETIME display format, have the same range of values, and there is no automatic initialization or updating to the current date and time.

mvh

Permalänk: https://www.webforum.nu/p/1452203

## #3 — AG, 2004-10-05T18:15Z

Fick det att fungera på annan dator, när jag använda myswql prompten 'alter table x add Tstamp TIMESTAMP;'

Dock funderar jag på om det finns något som gör att man i mysql kan sätta standardtid till EST.

Andreas

Permalänk: https://www.webforum.nu/p/1452661

## #4 — AG, 2004-10-06T19:53Z

Hittade följande sida:
<http://dev.mysql.com/doc/mysql/en/Time_zone_support.html>

Men det verkar som det bara fungerar på Unix, testade 'SET GLOBAL timze_zone = EST;' men får upp 'ERROR 1193: Unknown system variable 'time_zone''.
Någon lösning runt?

Andreas

Permalänk: https://www.webforum.nu/p/1453265

---

Tråden på webben: https://www.webforum.nu/amne/databaser-sql/112934-timestamp
