JULIAN TO GREGORIAN DATE UDF

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

This User Defined Function (UDF) is used to transform or cast the Julian date format to a Gregorian date format. Julian dates can be received in three different formats such as JD Edwards World, astronomy or ordinary format.

Custom UDF overloads

JULIAN_TO_GREGORIAN_DATE_UDF(julianDate, formatSelected)

It returns a string with the Gregorian date format YYYY-MM-DD.

Parameters:

JulianDate: The Julian date to be cast. It can be either CYYDDD (where C is the century) or YYYYDDD.

formatSelected: It represents the format in which the Julian date should be processed. Besides, it is a CHAR and can accept the following formats:

Format available
Letter representation in CHAR
Description

Astronomy standardized

'J'

It is the default format. The cast is based in the expected conversion of the Astronomical Applications Department of the US. The Julian Date format for this is YYYYDDD.

JD Edwards World

'E'

The expected Julian date to be received in this case should be CYYDDD (where C represents the century and is operationalized to be added 19 to the corresponding number).

Ordinal dates

'R'

The ordinal dates are an arrangement of numbers which represent a concisely date. The format is YYYYDDD and can be easily read because the year part is not mutable.

Usage Example

Oracle

  • Note: The date must be formatted in order to visualize all digits of the year.

Snowflake

Know Issues

  1. Any other format: If the Julian Date is formatted in any other not supported format, there would be differences in the output.

  2. Ranges of B.C. dates may represent inconsistencies due to unsupported Snowflake functions for dates.

No EWIs related.

Last updated