-
Notifications
You must be signed in to change notification settings - Fork 3
String Date Conversion
Databases usually provide a function to convert string values to dates/timestamps, such as “TO_TIMESTAMP(string, format)”. There are different types of format codes. The most common one is assembled based on the datetime parts. This section configures how Insights should generate the format parameter by assembling various parts.
- YY : 2 digit year
- YYYY : 4 digit year
- MM: month
- DD: day
- hh: hours (0-12)
- HH: hours (0-24)
- mm: minutes
- ss: seconds
- ms: fractional seconds
- mon: month names (in English)
- ampm: AM or PM
date and time sql tokens:
YY: yy
YYYY: yyyy
MM: MM
DD: dd
hh: hh
HH: HH
mm: mi
ss: ss
ms: ms
mon: mon
ampm: am
Based on the settings above, if the input string value is “1999-01-01 02:00:00.001 AM”, Insights will generate a format of “yyyy-MM-dd hh:mm:ss.ms am”.
For databases that uses other types of format codes, you may configure them in this section. You may also use this section if you always only work with a small number of datetime formats. Configuring them directly in this section will allow Insights to use the configured format directly instead of assembling them.
Note that “date format codes” section takes priority over “date and time sql tokens” section. It means if Insights finds a match in the date format codes list, it will not attempt to assemble a format by itself by using the tokens.
Here is a list of most common datetime formats (left), and you just need to update the values (right) for each based on your database syntaxes.
date format codes:
# US
"mm/dd/yy": mm/dd/yy
"mm/dd/yyyy": mm/dd/yyyy
# ANSI
"yy.mm.dd": yy.mm.dd
"yyyy.mm.dd": yyyy.mm.dd
# British/French
"dd/mm/yy": dd/mm/yy
"dd/mm/yyyy": dd/mm/yyyy
# German
"dd.mm.yy": dd.mm.yy
"dd.mm.yyyy": dd.mm.yyyy
# Italian
"dd-mm-yy": dd-mm-yy
"dd-mm-yyyy": dd-mm-yyyy
# Japan
"yy/mm/dd": yy/mm/dd
"yyyy/mm/dd": yyyy/mm/dd
# ISO
"yymmdd": yymmdd
"yyyymmdd": yyyymmdd
# month name
"dd mon yy": dd mon yy
"dd mon yyyy": dd mon yyyy
"Mon dd, yy": mon dd, yy
"Mon dd, yyyy": mon dd, yyyy
- What's new in the configuration files
- Create a connector type bundle
- Configure Identifier Setting
- Configure SQL Capabilities
- Configure Window Functions
- Configure SQL Clauses
- Configure SQL Functions
- Configure Column Types
- Configure JDBC Placeholders
- Configure String Date Conversion
- Configure Error States
- Troubleshoot connector type bundle errors
- Limitations