29 lines
1.2 KiB
Plaintext
29 lines
1.2 KiB
Plaintext
CREATE OR REPLACE FUNCTION EFT_NOM.translate_date ( p_conv_datetime IN DATE
|
|
, p_timezone_from IN VARCHAR2 DEFAULT cout_system_configuration.get_configuration_item('G_LOCAL_TIMEZONE')
|
|
, p_timezone_to IN VARCHAR2 DEFAULT cout_system_configuration.get_configuration_item('G_TARGET_TIMEZONE') )
|
|
RETURN DATE
|
|
IS
|
|
BEGIN
|
|
/**
|
|
-- FUNCTION translate_date --
|
|
-- Translate a given date from local timestamp to target timestamp
|
|
--
|
|
-- %param p_conv_datetime The date to be converted
|
|
-- %param p_timeszone_from The timezone we are converting FROM (default g_local_timezone = Europe/Budapest)
|
|
-- %param p_timezone_to The timezone we are converting TO (default g_target_timezone = GMT)
|
|
--
|
|
-- %return A date converted to the target timezone
|
|
*/
|
|
-- Convert the date
|
|
RETURN TO_DATE( TO_CHAR( FROM_TZ( TO_TIMESTAMP( TO_CHAR( p_conv_datetime, 'DDMMYYYYHH24MISS' )
|
|
, 'DDMMYYYYHH24MISS' )
|
|
, p_timezone_from) AT TIME ZONE p_timezone_to
|
|
, 'DD/MM/YYYY HH24:MI:SS' )
|
|
, 'DD/MM/YYYY HH24:MI:SS' );
|
|
EXCEPTION
|
|
WHEN others THEN
|
|
RAISE;
|
|
END translate_date;
|
|
/
|
|
|