75 lines
4.9 KiB
HTML
75 lines
4.9 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Date, time, and timestamp data types" />
|
||
|
<meta name="abstract" content="Date, time, and timestamp are data types represented in an internal form not seen by the SQL user." />
|
||
|
<meta name="description" content="Date, time, and timestamp are data types represented in an internal form not seen by the SQL user." />
|
||
|
<meta name="DC.subject" content="SELECT statement, date value, time value, timestamp value, statements, date value, time value, date format, time format, timestamp format" />
|
||
|
<meta name="keywords" content="SELECT statement, date value, time value, timestamp value, statements, date value, time value, date format, time format, timestamp format" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafytexas.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyspecifycurdate.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafydatearithmetic.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../db2/rbafzmstch2data.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbafydtts" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Date, time, and timestamp data types</title>
|
||
|
</head>
|
||
|
<body id="rbafydtts"><a name="rbafydtts"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Date, time, and timestamp data types</h1>
|
||
|
<div><p>Date, time, and timestamp are data types represented in an internal
|
||
|
form not seen by the SQL user. </p>
|
||
|
<div class="section"><p>Date, time, and timestamp can be represented by character string
|
||
|
values and assigned to character string variables. The database manager recognizes
|
||
|
the following as date, time, and timestamp values: </p>
|
||
|
<ul><li>A value returned by the DATE, TIME, or TIMESTAMP scalar functions.</li>
|
||
|
<li>A value returned by the CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP
|
||
|
special registers.</li>
|
||
|
<li><img src="./delta.gif" alt="Start of change" />A value of a character string in the ANSI/ISO standard
|
||
|
date, time, or timestamp format, for example, <strong>DATE</strong> '1950-01-01'.<img src="./deltaend.gif" alt="End of change" /></li>
|
||
|
<li>A character string when it is an operand of an arithmetic expression or
|
||
|
a comparison <em>and</em> the other operand is a date, time, or timestamp.
|
||
|
For example, in the predicate: <pre>… <strong>WHERE</strong> HIREDATE < '1950-01-01'</pre>
|
||
|
<p>if
|
||
|
HIREDATE is a date column, the character string '1950-01-01' is interpreted
|
||
|
as a date.</p>
|
||
|
</li>
|
||
|
<li>A character string variable or constant used to set a date, time, or timestamp
|
||
|
column in either the SET clause of an UPDATE statement, or the VALUES clause
|
||
|
of an INSERT statement.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rbafyspecifycurdate.htm">Specify current date and time values</a></strong><br />
|
||
|
You can specify a current date, time, or timestamp in an expression by specifying one of three special registers: CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbafydatearithmetic.htm">Date/time arithmetic</a></strong><br />
|
||
|
Addition and subtraction are the only arithmetic operators applicable to date, time, and timestamp values.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafytexas.htm" title="Learn a variety of ways of tailoring your query to gather data using the SELECT statement. One way to do this is to use the SELECT statement in a program to retrieve a specific row (for example, the row for an employee). Furthermore, you can use clauses to gather data in a specific way.">Retrieve data using the SELECT statement</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../db2/rbafzmstch2data.htm">Data types</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|