TODATE(Parameter 1,[Parameter 2])
Converts parameter values in various date formats to date types.
The value of Parameter 1 can be a number, string, or date. [Parameter 2] is used to parse the date format, such as MM/dd/yy.
Date
For details about parameter usage, see the "Example" section.
If any parameter value is NULL, the result is NULL.
In the format, the month must be uppercase MM, the year must be lowercase yy or yyyy, and the day must be lowercase dd.
TODATE(DATE(2007,12,12))
Returns the date object of December 12, 2007.
(Only returns the value of Parameter 1.)
The parameter value is returned directly as it is already of the date type.
TODATE(1023542354746)
Returns the date object of June 8, 2002.
The function can convert timestamp data to date data.
TODATE("2007/10/15")
Returns the date object of October 15, 2007.
The parameter value is a text in the date format, so the function returns the corresponding date.
TODATE("1/15/07","MM/dd/yy")
Returns the date object of January 15, 2007.(The month in Parameter 2 must be uppercase MM.)
(Returns the value of Parameter 1, which is parsed by the format specified by Parameter 2.)
The function contains two parameters. The value of the first parameter is a text in the date format, and the value of the second parameter is the format used to parse the date.
In particular, yyyyMMdd is used to parse dates such as 20081230.For example, TODATE("20110830","yyyymmdd") returns the date of August 30, 2011.
For example, add a New Calculation Column operator in a Data Transformation node and input the formula TODATE(1023542354746), as shown in the following figure.
The following figure shows the result.
To convert a date in the yyyy-MM-dd HH:mm:ss format to the yyyy-MM-dd format, use a formula similar to TODATE(FORMAT(2023-06-13 00:01:27,"yyyy-MM-dd")).
For more details about date formula syntax, see Common Date Formula.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy