git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@50874 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
28
Data/BulkLoad/EFT/Nominations/plsql/translate_date.fnc
Normal file
28
Data/BulkLoad/EFT/Nominations/plsql/translate_date.fnc
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
/
|
||||
|
||||
Reference in New Issue
Block a user