SlideShare a Scribd company logo
Managing Data in Different Time
Zones
Time Zones
• The hours of the day are measured by the
turning of the earth.
• The time of day at any particular moment
depends on where you are.
• The earth is divided into 24 time zones, one
for each hour of the day.
Time Zones
• Greenwich Mean Time GMT also known as
Coordinated Universal Time or UTC.
• UTC is the time standard against which all
other time zones in the world are referenced.
• All time is measured relative to UTC.
Time Zone Functions
– CURRENT_DATE:
• Returns the current date from the user session
• Has a data type of DATE
– CURRENT_TIMESTAMP:
• Returns the current date and time from the user
session
• Has a data type of TIMESTAMP WITH TIME ZONE
– LOCALTIMESTAMP:
• Returns the current date and time from the user
session
• Has a data type of TIMESTAMP
Time Zone Functions
• Display the value of the database time zone:
SELECT DBTIMEZONE FROM DUAL;
• Display the value of the session’s time zone:
SELECT SESSIONTIMEZONE FROM DUAL;
Timestamp Datatype
Same as the TIMESTAMP data type; also
includes a time zone offset in its value
TIMESTAMP WITH LOCAL
TIME ZONE
Same as the TIMESTAMP data type; also
includes:
TIMEZONE_HOUR, and TIMEZONE_MINUTE
or TIMEZONE_REGION
TIMESTAMP WITH TIME ZONE
Year, Month, Day, Hour, Minute, Second with
fractional seconds
TIMESTAMP
FieldsData Type
Time Zone Functions
• Display the YEAR component from the SYSDATE.
SELECT EXTRACT (YEAR FROM SYSDATE) FROM
DUAL;
• Display the MONTH component from the
HIRE_DATE
SELECT last_name, hire_date,
EXTRACT (MONTH FROM HIRE_DATE)
FROM employees
TimeZone Functions
• Display the character string '2007-03-06 11:00:00‘ as
a TIMESTAMP value:
SELECT TO_TIMESTAMP ('2007-03-06
11:00:00‘, YYYY-MM-DD HH:MI:SS')
FROM DUAL;
• Display a date that is 100 days and 10 hours after the
hire date for all the employees.
SELECT last_name, TO_CHAR(hire_date +
TO_DSINTERVAL('100 10:00:00'),
‘mm-dd-yy:hh:mi:ss') hiredate2
FROM employees;
TimeZone Functions
• Display a date that is one year and two months after
the hire date for the employees.
SELECT hire_date,
hire_date + TO_YMINTERVAL('01-02') AS
HIRE_DATE_YMININTERVAL
FROM employees
Changing TimeZone
• The TIME_ZONE parameter is set to –5:00
and then SELECT statements for each date
and time is executed to compare differences.
ALTER SESSION
SET NLS_DATE_FORMAT = 'DD-MON-YYYY
HH24:MI:SS';
ALTER SESSION SET TIME_ZONE = '-5:00';
SELECT SESSIONTIMEZONE, CURRENT_DATE,
CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM
DUAL;
Ad

More Related Content

Viewers also liked (12)

Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Oxya Agro e Biociências
 
Johanna Manyaka CV 2017
Johanna Manyaka CV 2017Johanna Manyaka CV 2017
Johanna Manyaka CV 2017
Johanna Manyaka
 
Danny Morris Resume 2016
Danny Morris Resume 2016Danny Morris Resume 2016
Danny Morris Resume 2016
Danny Morris
 
Linea del tiempo terapia manual
Linea del tiempo terapia manualLinea del tiempo terapia manual
Linea del tiempo terapia manual
Vanessa Catalina Vargas Rojas
 
Moving from Mandrill
Moving from MandrillMoving from Mandrill
Moving from Mandrill
Giedrius Rimkus
 
Amol waghmare slide share
Amol waghmare slide shareAmol waghmare slide share
Amol waghmare slide share
amol waghmare
 
Pós Graduação em Exportação e Internacionalização
Pós Graduação em Exportação e InternacionalizaçãoPós Graduação em Exportação e Internacionalização
Pós Graduação em Exportação e Internacionalização
Jorge Remondes
 
1.1. sandro araújo
1.1. sandro araújo1.1. sandro araújo
1.1. sandro araújo
Plataforma Tecnológica da Bicicleta e Mobilidade Suave
 
Intercultural non verbal communication
Intercultural non verbal communicationIntercultural non verbal communication
Intercultural non verbal communication
Talha Ghaffar
 
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Agneta Gallardo
 
How to build a business for Value
How to build a business for ValueHow to build a business for Value
How to build a business for Value
BizSmart Select
 
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy SystemsComputer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
IJEACS
 
Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Programa Estadual de Análise Fiscais de Resíduos de Agrotóxicos em Alimentos ...
Oxya Agro e Biociências
 
Danny Morris Resume 2016
Danny Morris Resume 2016Danny Morris Resume 2016
Danny Morris Resume 2016
Danny Morris
 
Amol waghmare slide share
Amol waghmare slide shareAmol waghmare slide share
Amol waghmare slide share
amol waghmare
 
Pós Graduação em Exportação e Internacionalização
Pós Graduação em Exportação e InternacionalizaçãoPós Graduação em Exportação e Internacionalização
Pós Graduação em Exportação e Internacionalização
Jorge Remondes
 
Intercultural non verbal communication
Intercultural non verbal communicationIntercultural non verbal communication
Intercultural non verbal communication
Talha Ghaffar
 
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Ejercicio practico LibreOffice Impress (Parque Selwo Marina)
Agneta Gallardo
 
How to build a business for Value
How to build a business for ValueHow to build a business for Value
How to build a business for Value
BizSmart Select
 
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy SystemsComputer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
Computer Aided Development of Fuzzy, Neural and Neuro-Fuzzy Systems
IJEACS
 

Similar to 10. timestamp (20)

Les05
Les05Les05
Les05
Sudharsan S
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Date object.pptx date and object v
Date object.pptx date and object        vDate object.pptx date and object        v
Date object.pptx date and object v
22x026
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
BREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE 3D Analyst for the Advanced AERMOD ModelerBREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE Software
 
Les16
Les16Les16
Les16
Vijay Kumar
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Date and Timestamp Types In Snowflake (By Faysal Shaarani)Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Faysal Shaarani (MBA)
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
Java 8 Date and Time API
Java 8 Date and Time APIJava 8 Date and Time API
Java 8 Date and Time API
Ganesh Samarthyam
 
How to work with dates and times in swift 3
How to work with dates and times in swift 3How to work with dates and times in swift 3
How to work with dates and times in swift 3
allanh0526
 
Understanding Sitecore Schedulers: Configuration and Execution Guide
Understanding Sitecore Schedulers: Configuration and Execution GuideUnderstanding Sitecore Schedulers: Configuration and Execution Guide
Understanding Sitecore Schedulers: Configuration and Execution Guide
Akshay Barve
 
Fun times with ruby
Fun times with rubyFun times with ruby
Fun times with ruby
Geoff Harcourt
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
 
SQL Server Temporal Tables
SQL Server Temporal TablesSQL Server Temporal Tables
SQL Server Temporal Tables
Greg McMurray
 
Configurable weather has been added to Scheduler Plus. Now you can set up the...
Configurable weather has been added to Scheduler Plus. Now you can set up the...Configurable weather has been added to Scheduler Plus. Now you can set up the...
Configurable weather has been added to Scheduler Plus. Now you can set up the...
eipconsultants15
 
Brand New Date and Time API
Brand New Date and Time APIBrand New Date and Time API
Brand New Date and Time API
Kenji HASUNUMA
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functions
ecomputernotes
 
Unit- 4, Time and Global States Clocks, events and process states
Unit- 4,  Time and  Global States Clocks, events and process statesUnit- 4,  Time and  Global States Clocks, events and process states
Unit- 4, Time and Global States Clocks, events and process states
PiyushSharma498360
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Introduction to Date and Time API 4
Introduction to Date and Time API 4Introduction to Date and Time API 4
Introduction to Date and Time API 4
Kenji HASUNUMA
 
Date object.pptx date and object v
Date object.pptx date and object        vDate object.pptx date and object        v
Date object.pptx date and object v
22x026
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
BREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE 3D Analyst for the Advanced AERMOD ModelerBREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE 3D Analyst for the Advanced AERMOD Modeler
BREEZE Software
 
Introduction to Date and Time API 3
Introduction to Date and Time API 3Introduction to Date and Time API 3
Introduction to Date and Time API 3
Kenji HASUNUMA
 
Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Date and Timestamp Types In Snowflake (By Faysal Shaarani)Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Date and Timestamp Types In Snowflake (By Faysal Shaarani)
Faysal Shaarani (MBA)
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
LagamaPasala
 
How to work with dates and times in swift 3
How to work with dates and times in swift 3How to work with dates and times in swift 3
How to work with dates and times in swift 3
allanh0526
 
Understanding Sitecore Schedulers: Configuration and Execution Guide
Understanding Sitecore Schedulers: Configuration and Execution GuideUnderstanding Sitecore Schedulers: Configuration and Execution Guide
Understanding Sitecore Schedulers: Configuration and Execution Guide
Akshay Barve
 
JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8JSR 310. New Date API in Java 8
JSR 310. New Date API in Java 8
Serhii Kartashov
 
SQL Server Temporal Tables
SQL Server Temporal TablesSQL Server Temporal Tables
SQL Server Temporal Tables
Greg McMurray
 
Configurable weather has been added to Scheduler Plus. Now you can set up the...
Configurable weather has been added to Scheduler Plus. Now you can set up the...Configurable weather has been added to Scheduler Plus. Now you can set up the...
Configurable weather has been added to Scheduler Plus. Now you can set up the...
eipconsultants15
 
Brand New Date and Time API
Brand New Date and Time APIBrand New Date and Time API
Brand New Date and Time API
Kenji HASUNUMA
 
e computer notes - Date time functions
e computer notes - Date time functionse computer notes - Date time functions
e computer notes - Date time functions
ecomputernotes
 
Unit- 4, Time and Global States Clocks, events and process states
Unit- 4,  Time and  Global States Clocks, events and process statesUnit- 4,  Time and  Global States Clocks, events and process states
Unit- 4, Time and Global States Clocks, events and process states
PiyushSharma498360
 
Ad

More from Amrit Kaur (20)

File Organization
File OrganizationFile Organization
File Organization
Amrit Kaur
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
Amrit Kaur
 
ER diagram
ER diagramER diagram
ER diagram
Amrit Kaur
 
Transaction Processing
Transaction ProcessingTransaction Processing
Transaction Processing
Amrit Kaur
 
Normalization
NormalizationNormalization
Normalization
Amrit Kaur
 
Sample Interview Question
Sample Interview QuestionSample Interview Question
Sample Interview Question
Amrit Kaur
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
Amrit Kaur
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
Amrit Kaur
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized table
Amrit Kaur
 
8. transactions
8. transactions8. transactions
8. transactions
Amrit Kaur
 
7. exceptions handling in pl
7. exceptions handling in pl7. exceptions handling in pl
7. exceptions handling in pl
Amrit Kaur
 
6. triggers
6. triggers6. triggers
6. triggers
Amrit Kaur
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
Amrit Kaur
 
4. plsql
4. plsql4. plsql
4. plsql
Amrit Kaur
 
3. ddl create
3. ddl create3. ddl create
3. ddl create
Amrit Kaur
 
2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE
Amrit Kaur
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
Amrit Kaur
 
Chapter 8 Inheritance
Chapter 8 InheritanceChapter 8 Inheritance
Chapter 8 Inheritance
Amrit Kaur
 
Chapter 7 C++ As OOP
Chapter 7 C++ As OOPChapter 7 C++ As OOP
Chapter 7 C++ As OOP
Amrit Kaur
 
Chapter 6 OOPS Concept
Chapter 6 OOPS ConceptChapter 6 OOPS Concept
Chapter 6 OOPS Concept
Amrit Kaur
 
File Organization
File OrganizationFile Organization
File Organization
Amrit Kaur
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
Amrit Kaur
 
Transaction Processing
Transaction ProcessingTransaction Processing
Transaction Processing
Amrit Kaur
 
Sample Interview Question
Sample Interview QuestionSample Interview Question
Sample Interview Question
Amrit Kaur
 
12. oracle database architecture
12. oracle database architecture12. oracle database architecture
12. oracle database architecture
Amrit Kaur
 
11. using regular expressions with oracle database
11. using regular expressions with oracle database11. using regular expressions with oracle database
11. using regular expressions with oracle database
Amrit Kaur
 
9. index and index organized table
9. index and index organized table9. index and index organized table
9. index and index organized table
Amrit Kaur
 
8. transactions
8. transactions8. transactions
8. transactions
Amrit Kaur
 
7. exceptions handling in pl
7. exceptions handling in pl7. exceptions handling in pl
7. exceptions handling in pl
Amrit Kaur
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
Amrit Kaur
 
2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE2. DML_INSERT_DELETE_UPDATE
2. DML_INSERT_DELETE_UPDATE
Amrit Kaur
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
Amrit Kaur
 
Chapter 8 Inheritance
Chapter 8 InheritanceChapter 8 Inheritance
Chapter 8 Inheritance
Amrit Kaur
 
Chapter 7 C++ As OOP
Chapter 7 C++ As OOPChapter 7 C++ As OOP
Chapter 7 C++ As OOP
Amrit Kaur
 
Chapter 6 OOPS Concept
Chapter 6 OOPS ConceptChapter 6 OOPS Concept
Chapter 6 OOPS Concept
Amrit Kaur
 
Ad

Recently uploaded (20)

The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptxSCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
SCI BIZ TECH QUIZ (OPEN) PRELIMS XTASY 2025.pptx
Ronisha Das
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 

10. timestamp

  • 1. Managing Data in Different Time Zones
  • 2. Time Zones • The hours of the day are measured by the turning of the earth. • The time of day at any particular moment depends on where you are. • The earth is divided into 24 time zones, one for each hour of the day.
  • 3. Time Zones • Greenwich Mean Time GMT also known as Coordinated Universal Time or UTC. • UTC is the time standard against which all other time zones in the world are referenced. • All time is measured relative to UTC.
  • 4. Time Zone Functions – CURRENT_DATE: • Returns the current date from the user session • Has a data type of DATE – CURRENT_TIMESTAMP: • Returns the current date and time from the user session • Has a data type of TIMESTAMP WITH TIME ZONE – LOCALTIMESTAMP: • Returns the current date and time from the user session • Has a data type of TIMESTAMP
  • 5. Time Zone Functions • Display the value of the database time zone: SELECT DBTIMEZONE FROM DUAL; • Display the value of the session’s time zone: SELECT SESSIONTIMEZONE FROM DUAL;
  • 6. Timestamp Datatype Same as the TIMESTAMP data type; also includes a time zone offset in its value TIMESTAMP WITH LOCAL TIME ZONE Same as the TIMESTAMP data type; also includes: TIMEZONE_HOUR, and TIMEZONE_MINUTE or TIMEZONE_REGION TIMESTAMP WITH TIME ZONE Year, Month, Day, Hour, Minute, Second with fractional seconds TIMESTAMP FieldsData Type
  • 7. Time Zone Functions • Display the YEAR component from the SYSDATE. SELECT EXTRACT (YEAR FROM SYSDATE) FROM DUAL; • Display the MONTH component from the HIRE_DATE SELECT last_name, hire_date, EXTRACT (MONTH FROM HIRE_DATE) FROM employees
  • 8. TimeZone Functions • Display the character string '2007-03-06 11:00:00‘ as a TIMESTAMP value: SELECT TO_TIMESTAMP ('2007-03-06 11:00:00‘, YYYY-MM-DD HH:MI:SS') FROM DUAL; • Display a date that is 100 days and 10 hours after the hire date for all the employees. SELECT last_name, TO_CHAR(hire_date + TO_DSINTERVAL('100 10:00:00'), ‘mm-dd-yy:hh:mi:ss') hiredate2 FROM employees;
  • 9. TimeZone Functions • Display a date that is one year and two months after the hire date for the employees. SELECT hire_date, hire_date + TO_YMINTERVAL('01-02') AS HIRE_DATE_YMININTERVAL FROM employees
  • 10. Changing TimeZone • The TIME_ZONE parameter is set to –5:00 and then SELECT statements for each date and time is executed to compare differences. ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; ALTER SESSION SET TIME_ZONE = '-5:00'; SELECT SESSIONTIMEZONE, CURRENT_DATE, CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM DUAL;