Working with Time Zones in Oracle Business Intelligence Publisher ORACLE WHITE PAPER JULY 2014

Similar documents
Generate Invoice and Revenue for Labor Transactions Based on Rates Defined for Project and Task

Creating Custom Project Administrator Role to Review Project Performance and Analyze KPI Categories

Using the Oracle Business Intelligence Publisher Memory Guard Features. August 2013

Oracle CIoud Infrastructure Load Balancing Connectivity with Ravello O R A C L E W H I T E P A P E R M A R C H

An Oracle White Paper November Primavera Unifier Integration Overview: A Web Services Integration Approach

Configuring Oracle Business Intelligence Enterprise Edition to Support Teradata Database Query Banding

Loading User Update Requests Using HCM Data Loader

Correction Documents for Poland

Automatic Receipts Reversal Processing

Installation Instructions: Oracle XML DB XFILES Demonstration. An Oracle White Paper: November 2011

Tutorial on How to Publish an OCI Image Listing

Oracle DIVArchive Storage Plan Manager

JD Edwards EnterpriseOne Licensing

Oracle Fusion Configurator

Oracle Cloud Applications. Oracle Transactional Business Intelligence BI Catalog Folder Management. Release 11+

Veritas NetBackup and Oracle Cloud Infrastructure Object Storage ORACLE HOW TO GUIDE FEBRUARY 2018

Load Project Organizations Using HCM Data Loader O R A C L E P P M C L O U D S E R V I C E S S O L U T I O N O V E R V I E W A U G U S T 2018

Oracle Data Provider for.net Microsoft.NET Core and Entity Framework Core O R A C L E S T A T E M E N T O F D I R E C T I O N F E B R U A R Y

Oracle Data Masking and Subsetting

Achieving High Availability with Oracle Cloud Infrastructure Ravello Service O R A C L E W H I T E P A P E R J U N E

Handling Memory Ordering in Multithreaded Applications with Oracle Solaris Studio 12 Update 2: Part 2, Memory Barriers and Memory Fences

An Oracle White Paper December, 3 rd Oracle Metadata Management v New Features Overview

An Oracle White Paper September Security and the Oracle Database Cloud Service

An Oracle White Paper July Oracle WebCenter Portal: Copying a Runtime-Created Skin to a Portlet Producer

Subledger Accounting Reporting Journals Reports

Oracle Enterprise Data Quality New Features Overview

Oracle NoSQL Database For Time Series Data O R A C L E W H I T E P A P E R D E C E M B E R

Oracle Secure Backup. Getting Started. with Cloud Storage Devices O R A C L E W H I T E P A P E R F E B R U A R Y

Siebel CRM Applications on Oracle Ravello Cloud Service ORACLE WHITE PAPER AUGUST 2017

Oracle NoSQL Database Parent-Child Joins and Aggregation O R A C L E W H I T E P A P E R A P R I L,

RAC Database on Oracle Ravello Cloud Service O R A C L E W H I T E P A P E R A U G U S T 2017

An Oracle White Paper October The New Oracle Enterprise Manager Database Control 11g Release 2 Now Managing Oracle Clusterware

April Understanding Federated Single Sign-On (SSO) Process

August 6, Oracle APEX Statement of Direction

An Oracle Technical Article March Certification with Oracle Linux 4

Leverage the Oracle Data Integration Platform Inside Azure and Amazon Cloud

Sun Fire X4170 M2 Server Frequently Asked Questions

Hard Partitioning with Oracle VM Server for SPARC O R A C L E W H I T E P A P E R J U L Y

VISUAL APPLICATION CREATION AND PUBLISHING FOR ANYONE

Oracle Learn Cloud. Taleo Release 16B.1. Release Content Document

Pricing Cloud: Upgrading to R13 - Manual Price Adjustments from the R11/R12 Price Override Solution O R A C L E W H I T E P A P E R A P R I L

Oracle NoSQL Database Parent-Child Joins and Aggregation O R A C L E W H I T E P A P E R M A Y,

StorageTek ACSLS Manager Software Overview and Frequently Asked Questions

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Oracle Clusterware 18c Technical Overview O R A C L E W H I T E P A P E R F E B R U A R Y

WebCenter Portal Task Flow Customization in 12c O R A C L E W H I T E P A P E R J U N E

Oracle Enterprise Performance Reporting Cloud. What s New in September 2016 Release (16.09)

Using Oracle In-Memory Advisor with JD Edwards EnterpriseOne

Establishing secure connections between Oracle Ravello and Oracle Database Cloud O R A C L E W H I T E P A P E R N O V E M E B E R

October Oracle Application Express Statement of Direction

Oracle Financial Services Regulatory Reporting for US Federal Reserve Lombard Risk Integration Pack

Oracle Express CPQ for Salesforce.com

An Oracle Technical Article November Certification with Oracle Linux 7

An Oracle White Paper September, Oracle Real User Experience Insight Server Requirements

Integrating Oracle SuperCluster Engineered Systems with a Data Center s 1 GbE and 10 GbE Networks Using Oracle Switch ES1-24

Repairing the Broken State of Data Protection

Migrating VMs from VMware vsphere to Oracle Private Cloud Appliance O R A C L E W H I T E P A P E R O C T O B E R

See What's Coming in Oracle Taleo Business Edition Cloud Service

TABLE OF CONTENTS DOCUMENT HISTORY 3

Oracle Service Registry - Oracle Enterprise Gateway Integration Guide

Oracle Fusion General Ledger Hierarchies: Recommendations and Best Practices. An Oracle White Paper April, 2012

Oracle WebLogic Portal O R A C L E S T A T EM EN T O F D I R E C T IO N F E B R U A R Y 2016

Transitioning from Oracle Directory Server Enterprise Edition to Oracle Unified Directory

Technical White Paper August Recovering from Catastrophic Failures Using Data Replicator Software for Data Replication

Data Capture Recommended Operating Environments

Oracle Social Network

New Oracle NoSQL Database APIs that Speed Insertion and Retrieval

An Oracle Technical Article August Certification with Oracle Linux 7

Oracle Business Activity Monitoring 12c Best Practices ORACLE WHITE PAPER DECEMBER 2015

Deploying Custom Operating System Images on Oracle Cloud Infrastructure O R A C L E W H I T E P A P E R M A Y

Oracle FLEXCUBE Direct Banking Release Corporate Cash Management User Manual. Part No. E

An Oracle White Paper July Methods for Downgrading from Oracle Database 11g Release 2

Oracle Communications Interactive Session Recorder and Broadsoft Broadworks Interoperability Testing. Technical Application Note

SOA Cloud Service Automatic Service Migration

Handling Memory Ordering in Multithreaded Applications with Oracle Solaris Studio 12 Update 2: Part 1, Compiler Barriers

An Oracle White Paper Oct Hard Partitioning With Oracle Solaris Zones

Frequently Asked Questions Oracle Content Management Integration. An Oracle White Paper June 2007

Extreme Performance Platform for Real-Time Streaming Analytics

Oracle Spatial and Graph: Benchmarking a Trillion Edges RDF Graph ORACLE WHITE PAPER NOVEMBER 2016

Product Release Notes

Product Release Notes

Cloud Operations for Oracle Cloud Machine ORACLE WHITE PAPER MARCH 2017

Oracle Best Practices for Managing Fusion Application: Discovery of Fusion Instance in Enterprise Manager Cloud Control 12c

Oracle Learn Cloud. What s New in Release 15B.1

Oracle Forms Services Oracle Traffic Director Configuration

An Oracle White Paper October Deploying and Developing Oracle Application Express with Oracle Database 12c

Oracle Utilities CC&B V2.3.1 and MDM V2.0.1 Integrations. Utility Reference Model Synchronize Master Data

Oracle FLEXCUBE Direct Banking Release Dashboard Widgets Transfer Payments User Manual. Part No. E

Oracle Database 12c: JMS Sharded Queues

How to Monitor Oracle Private Cloud Appliance with Oracle Enterprise Manager 13c O R A C L E W H I T E P A P E R J U L Y

Product Release Notes

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Establishing secure connectivity between Oracle Ravello and Oracle Cloud Infrastructure Database Cloud ORACLE WHITE PAPER DECEMBER 2017

An Oracle White Paper June StorageTek In-Drive Reclaim Accelerator for the StorageTek T10000B Tape Drive and StorageTek Virtual Storage Manager

Automatic Data Optimization with Oracle Database 12c O R A C L E W H I T E P A P E R S E P T E M B E R

Overview. Implementing Fibre Channel SAN Boot with the Oracle ZFS Storage Appliance. January 2014 By Tom Hanvey; update by Peter Brouwer Version: 2.

Oracle Flash Storage System QoS Plus Operation and Best Practices ORACLE WHITE PAPER OCTOBER 2016

SecureFiles Migration O R A C L E W H I T E P A P E R F E B R U A R Y

Oracle Database Vault

An Oracle Technical White Paper September Detecting and Resolving Oracle Solaris LUN Alignment Problems

Transcription:

Working with Time Zones in Oracle Business Intelligence Publisher ORACLE WHITE PAPER JULY 2014

Table of Contents Introduction 1 Time Zones in Oracle BI Publisher Reports 2 Converting Dates to the User Preferred Time Zone 2 Preventing Time Zone Conversion of a Date 2 Converting Dates to a Specific Time Zone 3 Time Zone Settings 4 DB Time Zone 4 JVM Time Zone 4 User Preferred Time Zone 5 Time Zones Treatment in Oracle BI Publisher Reports 6 Understanding Time Zone Conversion 6 Understanding How to Prevent Time Zone Conversion 6 Understanding Date Conversion to a Specific Time Zone 7. WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Introduction Oracle provides a range of features to support customers who conduct business across different time zones. Time zone settings can influence the values of date and time fields displayed in Oracle Business Intelligence Publisher (BI Publisher) reports. Date and time fields are implemented using the following date time data types:» DATE» TIMESTAMP» TIMESTAMP WITH TIME ZONE» TIMESTAMP WITH LOCAL TIME ZONE These data types enable consistent information to be stored about the time of events and transactions, while also supporting the requirement to display values in different time zones. This white paper describes the following time zone features:» Time Zones in Oracle BI Publisher Reports: Simple instructions to implement the different reporting scenarios in Oracle BI Publisher reports without the need to understand the time zone settings and how they impact the values reported.» Time Zone Settings: An overview of the time zone settings that impact the value of date time fields in different reporting scenarios.» Time Zones Treatment in Oracle BI Publisher Reports: Different reporting scenarios that highlight the impact of time zone settings. 1 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Time Zones in Oracle BI Publisher Reports There are several ways that you can set the time zones to meet your requirements. The following reporting scenarios are described with simple instructions on how to address each situation:» Converting dates to the user preferred time zone» Preventing time zone conversion of a date» Converting dates to a specific time zone Converting Dates to the User Preferred Time Zone Date fields selected in the data model are automatically converted to the time zone specified in the Oracle BI Publisher user preferences. This is the default behavior for a date field. You can format the date field using one of the following format masks: <?format-date:transaction_date; XDODEFDATE?> <?format-date:transaction_date; XDODEFDATE XDODEFTIME?> For more information on XDODEFDATE and XDODEFTIME, see Implementing Localization Formatting in Oracle BI Publisher Reports in the Oracle Fusion Applications Developer s Guide. Preventing Time Zone Conversion of a Date To prevent a date from being converted to the user preferred time zone in a report, use the following steps: 1. Convert the date to a string in the data model using one of the following commands: TO_CHAR(<DATETIME>, YYYY-MM-DD ) TO_CHAR(<DATETIME>, YYYY-MM-DD T HH24:MI:SS ) 2. In your RTF layout template, use XDODEFDATE or XDODEFTIME to format the date: <?format-date:transaction_date; XDODEFDATE?> <?format-date:transaction_date; XDODEFDATE XDODEFTIME?> 2 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Converting Dates to a Specific Time Zone Use the function FROM_TZ to convert a date field to another time zone. For example, to convert the field TRANSACTION_DATE from the data base time zone to the time zone of America/Los_Angeles, use the following command: FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone 'America/Los_Angeles' To prevent the above date from being converted to the user preferred time zone, use the TO_CHAR function. For example: SELECT TO_CHAR( FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone 'America/Los_Angeles', YYYY-MM-DD ) creation_date FROM ap_invoices_all To convert a date to the user preferred time zone, use SESSIONTIMEZONE: SELECT TO_CHAR( FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone SESSIONTIMEZONE, YYYY-MM-DD ) creation_date FROM ap_invoices_all Note: You do not need to wrap the FROM_TZ with TO_CHAR if you are using the WHERE clause of the data model s SQL statement. For a list of the available time zones, run the following SQL statement: SELECT * FROM V$TIMEZONE_NAMES ORDER BY TZNAME, TZABBREV; 3 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Time Zone Settings There are three time zone settings that influence the reporting of date and time fields:» Database (DB) time zone» Java Virtual Machine (JVM) time zone» User preferred time zone The following technical details are not required reading to be able to properly set time zones in Oracle BI Publisher reports. DB Time Zone DB time zone is the setting at the database level and the actual time zone in which the date and time fields are stored by default. For example, the user interface may display the following date field in Pacific Standard Time (UTC-08:00): 01 January 2014 23:00 PST In a database with a DB time zone of UTC, the actual date and time stored in the date field is: 02-January 2014 07:00 JVM Time Zone When running an Oracle BI Publisher report, Java Database Connectivity (JDBC) retrieves the data from the database and generates the XML. During this process, the date fields in the XML are converted to the java canonical format. To convert the date field to the canonical format when a time element or time zone is not included, JDBC adds a time of midnight (00:00:00) to the time zone of the JVM. For example, consider the following simple query in a data model: SELECT TO_DATE('01-JAN-2014', 'DD-MON-YYYY') TRANSACTION_DATE FROM dual The generated XML converts the date field to the following canonical format: <TRANSACTION_DATE>2014-01-01T00:00:00.000-07:00</TRANSACTION_DATE> 4 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

The inclusion of the time and time zone information could result in an adjustment to the displayed date value when a user views the report in a different time zone. User Preferred Time Zone Oracle BI Publisher enables the user to specify which time zone to use for reports, as well as the date and time format. For example, a user in Honolulu would want to see their dates and times reported in the UTC-10:00 time zone. For reports to display the dates and times in the format defined in the Oracle Fusion Applications preferences, use the format masks XDODEFDATE and XDODEFTIME. In the report layout, you format the field using the following command: <?format-date:transaction_date; XDODEFDATE?> The above date would also be displayed in the user preferred time zone. Consider the following command in the XML generated by the data model: <TRANSACTION_DATE>2014-01-01T00:00:00.000-07:00</TRANSACTION_DATE> A user whose preferred time zone is set to Honolulu UTC-10:00 would see the following value reported, although the format would depend upon the Oracle Fusion Applications preferences: Figure 1.Sample output of a user preferred time zone The date value has been shifted back to the previous day because:» The JVM appends midnight (00:00:00) and the time zone UTC-07:00 to the value in the XML to convert the date to the canonical format.» The date is shifted back an additional three hours into the previous day because the layout displays the dates in the user preferred time zone of UTC-10:00.» Three hours is the difference between the user preferred time zone of UTC-10:00 and the time zone appended to the date in the XML of UTC-07:00. 5 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Time Zones Treatment in Oracle BI Publisher Reports This section discusses in greater depth the different reporting requirements detailed in the section Time Zones in Oracle BI Publisher Reports and the impact of settings described in the section Time Zone Settings, such as:» Understanding time zone conversion» Understanding how to prevent time zone conversion» Understanding date conversion to a specific time zone Understanding Time Zone Conversion Time zone conversion typically follows these steps: 1. Dates in the XML generated by the report s data model are automatically converted to canonical format using the JVM time zone. 2. The date field is converted to the time zone specified in the user preferences. 3. The format masks XDODEFDATE and XDODEFTIME determine the format used for the date according to the Oracle Fusion Applications preferences. For example: <?format-date:transaction_date; XDODEFDATE?> <?format-date:transaction_date; XDODEFDATE XDODEFTIME?> For more details on the user preferences setting, see Setting Preferences in the Oracle Fusion Middleware User s Guide for Oracle Business Intelligence Enterprise Edition. Understanding How to Prevent Time Zone Conversion There may be some dates in your report that you do not want to convert to the user preferred time zone. For example, you may want to see the actual date value displayed in the DB time zone. Since the JVM will convert date fields in the XML to canonical format, you must convert the date time field to a string in the data model using the function TO_CHAR. For example: TO_CHAR(TRANSACTION_DATE,YYYY-MM-DD ) Note: Using the TRUNC function on a date time field in the SELECT clause will not prevent the JVM from converting the date time field to the canonical format. Although TRUNC(<DATETIME>) resets the time to 00:00:00, the field is still a DATE data type. Therefore, you should use the TO_CHAR function instead. 6 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

You can format the date in the report layout using XDODEFDATE to display the DB time zone and not the user preferred time zone. To use XDODEFDATE and XDODEFTIME, specific format masks must be used when converting the date time field to a string. The format masks should be one of the following: TO_CHAR(<DATETIME>, YYYY-MM-DD ) TO_CHAR(<DATETIME>, YYYY-MM-DD T HH24:MI:SS ) Understanding Date Conversion to a Specific Time Zone There may be situations when you want to convert the dates stored in the DB time zone to another time zone. For example, a multinational company has a DB time zone of UTC but they have a requirement to report transactions that were entered during the work day in the Pacific time zone (UTC-:08;00) on 01 January 2014. For this date conversion, you can use the function FROM_TZ in the following command: FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone 'America/Los_Angeles' This command converts the field TRANSACTION_DATE from the DB time zone to the time zone 'America/Los_Angeles'. If a transaction has a CREATION_DATE of 02 January 2014 00:01 in the database which is using the UTC time zone, then the above command would return the date below in UTC-08:00: 01 January 2014 16:01 To display the date in your report, use the following statement in the data model: SELECT TO_CHAR( FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone 'America/Los_Angeles', YYYY-MM-DD ) creation_date FROM ap_invoices_all This will result in the following value in the XML which can be formatted using XDODEFDATE in the report layout, ensuring that no further time zone conversion will take place: <CREATION_DATE>2014-01-01</CREATION_DATE> 7 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

To include the command in your WHERE clause and only consider the date and not the time element of the date time field, you can either use the TO_CHAR or the TRUNC function. Using TRUNC in the SELECT clause will not prevent a date time field from being converted into the canonical format by the JVM when creating the XML. However, you can still use TRUNC in the WHERE clause. For example: SELECT TO_CHAR( FROM_TZ(CREATION_DATE, DBTIMEZONE) at time zone 'America/Los_Angeles', YYYY-MM-DD ) creation_date FROM ap_invoices_all WHERE TRUNC(FROM_TZ(creation_date, DBTIMEZONE) at time zone 'America/Los_Angeles') = TO_DATE('01-JAN-2014','DD-MON-YYYY') 8 WORKING WITH TIME ZONES IN ORACLE BUSINESS INTELLIGENCE PUBLISHER

Oracle Corporation, World Headquarters Worldwide Inquiries 500 Oracle Parkway Phone: +1.650.506.7000 Redwood Shores, CA 94065, USA Fax: +1.650.506.7200 CONNECT WITH US blogs.oracle.com/oracle facebook.com/oracle twitter.com/oracle oracle.com Copyright 2014, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0714