Convert String date format in Jalali to Gregorian

oracleoracle-12c

Hello I have The data table in oracle SQL 12c with 2 col one is thetime , and another is theh the data stored in cols are varchar and format like this :

THETIME | THEH
14000207| 1245
14000207| 1230
14000207| 1215
...

which the 14000207 tell is 1400(yyyy) , 02(MM) and 07(dd) and in THEH 12(HH) and 45(mm) I need to convert it to date format with time for better selecting the data but it's a jalali date and Before do that I need converting to Gregorian , so how Can I do that?
ps :

the 1400-02-07 equal to 2021-04-27

Best Answer

Try this one:

ALTER SESSION SET NLS_CALENDAR = 'Persian';

SELECT TO_DATE(THETIME || THEH, 'YYYYMMDDHH24MI')
FROM dual;