Search Results time_diff_server_to_client
Overview
CSFW_TIMEZONE_PUB is a public PL/SQL package body owned by the APPS schema in Oracle E-Business Suite (12.1.1 and 12.2.2). It provides a centralized utility layer for converting between server and client time zones, and for computing the offset between them. The package is part of the CRM Foundation (CSF) time zone infrastructure and abstracts the underlying time zone conversion logic provided by HZ_TIMEZONE_PUB. Its primary role is to allow applications to translate a date value expressed in the database server's time zone into the equivalent value in the end user's client time zone, and vice versa.
The package honors the value of the CLIENT_TIMEZONE_ID and SERVER_TIMEZONE_ID profile options. When the FND time zone feature is not enabled (that is, when fnd_timezones.timezones_enabled does not return 'Y'), the package degrades gracefully: conversion routines simply return their input unchanged, and the offset routine returns zero.
Key Procedures and Functions
- GET_CLIENT_TIME — Accepts a server-side date and returns the corresponding date in the client time zone. It derives the client and server time zone identifiers from the CLIENT_TIMEZONE_ID and SERVER_TIMEZONE_ID profile options and delegates the actual conversion to HZ_TIMEZONE_PUB.GET_TIME.
- TIME_DIFF_SERVER_TO_CLIENT — Returns a NUMBER representing the difference between server time and client time. This is the routine associated with the user search term "time_diff_server_to_client." It captures the current SYSDATE on the server, converts it to the equivalent client time via HZ_TIMEZONE_PUB.GET_TIME, and subtracts the client value from the server value. The sign of the result indicates whether the client is ahead of or behind the server. When time zones are disabled, the function returns 0, making it safe for callers that do not require adjustment.
- GET_SERVER_TIME — Performs the inverse operation of GET_CLIENT_TIME: it accepts a client-side time value (supplied as a string together with a date format) and returns the corresponding server time.
All three functions read the profile options through fnd_profile.value_specific. The header comment carries the revision marker $Header: csfwtznb.pls 115.5 2003/10/16, reflecting a stable, long-lived implementation.
Tables Accessed
The package does not directly read or write application tables through APPS synonyms. Its persistence and configuration dependencies are satisfied indirectly through FND profile option lookups (CLIENT_TIMEZONE_ID, SERVER_TIMEZONE_ID) and through the external call to HZ_TIMEZONE_PUB.GET_TIME, which performs the time zone rules resolution. Because the conversion logic is encapsulated in HZ_TIMEZONE_PUB, CSFW_TIMEZONE_PUB itself maintains no table-level dependencies.
Usage Notes
CSFW_TIMEZONE_PUB is typically invoked from PL/SQL-based application logic, including Oracle Forms personalizations and libraries, concurrent program bodies, and custom extensions, wherever a value must be displayed to or received from a user in their local time zone. The package is referenced by two other packages within the EBS codebase, confirming its role as a shared service. Developers should call TIME_DIFF_SERVER_TO_CLIENT when they need a numeric offset for arithmetic on dates, and GET_CLIENT_TIME / GET_SERVER_TIME when converting discrete date values. Because the functions honor the global time zone enablement flag, custom code can call them unconditionally without first checking whether time zone support is active.