Use timestamps : Timestamp « SQL Data Types « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » SQL Data Types » Timestamp 
10. 12. 1. Use timestamps

Timestamps store a specific date and time.

A timestamp stores the century, all four digits of a year, the month, the day, the hour (in 24-hour format), the minute, and the second.

The timestamp can store a fractional second, DATE cannot.

Timestamp can store a time zone.

A timestamp stores

  1. the century,
  2. all four digits of a year,
  3. the month,
  4. the day,
  5. the hour (in 24-hour format),
  6. the minute, and
  7. the second.

The advantages of a timestamp over a DATE are

  1. A timestamp can store a fractional second.
  2. A timestamp can store a time zone.

There are three timestamp types

TIMESTAMP[(seconds_precision)] Stores the

  1. century,
  2. all four digits of a year,
  3. the month,
  4. the day,
  5. the hour (in 24-hour format),
  6. the minute, and
  7. the second.

You can specify an optional precision for the seconds by supplying seconds_precision

The seconds_precision can be an integer from 0 to 9.

The default is 6; which means you can store up to 6 digits to the right of the decimal point for your second.

If you try to add a row with more digits in your fractional second than your TIMESTAMP can store, your fraction is rounded.

  1. TIMESTAMP[(seconds_precision)] WITH TIME ZONE Extends TIMESTAMP to store a time zone.
  2. TIMESTAMP[(seconds_precision)] WITH LOCAL TIME ZONE Extends TIMESTAMP to convert a supplied datetime to the local time zone set for the database. The process of conversion is known as normalizing the datetime.

Quote from:

Oracle Database 10g SQL (Osborne ORACLE Press Series) (Paperback)

# Paperback: 608 pages

# Publisher: McGraw-Hill Osborne Media; 1st edition (February 20, 2004)

# Language: English

# ISBN-10: 0072229810

# ISBN-13: 978-0072229813

10. 12. Timestamp
10. 12. 1. Use timestamps
10. 12. 2. timestamp column
10. 12. 3. Insert data into timestamp column
10. 12. 4. Using the TIMESTAMP Type
10. 12. 5. Round a timestamp
10. 12. 6. Use timestamp in insert statement
10. 12. 7. TIMESTAMP literal supports Time Zone (as offset from UTC). Default is SESSION Timezone:
10. 12. 8. A normalization to DB timezone:
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.