converting zulu format to date and time format
anjali5Nov 10 2011 — edited Nov 10 2011I want to convert zulu format to regular dateand time format. so for e.g I have this date and time in my table
021731ZJUN06, I want to convert it to 2006-06-02 17:31:00
I wrote this in sql server, but don't know how to do this in oracle
ALTER function [dbo].[ZULUToDateTime](@initDate varchar(20))
RETURNS datetime
AS
BEGIN
DECLARE @NewDate datetime
SET @NewDate = NULL
IF @initDate <> 'false'
BEGIN
SET @NewDate= CONVERT(datetime,LEFT(@initDate,2)+ ' ' + STUFF(right(@initDate,5),4,0,' ') + ' ' +STUFF(SUBSTRING(@initDate,3,4),3,0,':'),121)
END
RETURN @NewDate
END