cancel
Showing results for 
Search instead for 
Did you mean: 

Can't apply date functions to a date column

bradwyatt
New Contributor II

Hello,
I get “Unknown method” when applying any date-related snaplogic function to a column that is a local-date-time.

I tried this with two separate clients with different schemas and data types, still same issue. Is this a bug?

image (8)

1 ACCEPTED SOLUTION

tlikarish
Employee
Employee

There is a DateTime type and a LocalDateTime type. Here is an example that shows the difference and one way to convert from the LocalDateTime to a DateTime type.

Date.parse($local.toString()).getFullYear()

date-example_2021_05_10.slp (7.9 KB)

Here are how we convert some common database types into the Expression Language types in case it’s helpful for you.

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438184/Database+Date+Types

View solution in original post

1 REPLY 1

tlikarish
Employee
Employee

There is a DateTime type and a LocalDateTime type. Here is an example that shows the difference and one way to convert from the LocalDateTime to a DateTime type.

Date.parse($local.toString()).getFullYear()

date-example_2021_05_10.slp (7.9 KB)

Here are how we convert some common database types into the Expression Language types in case it’s helpful for you.

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438184/Database+Date+Types