TODATE - Converting to the Date Type

  • Last update:December 25, 2024
  • Extracted Data

    1. Overview

    Syntax

    TODATE()

    Converts parameters in various date formats to date type.

    2. Notes

    • The function supports five parameter formats.

    • When you use one parameter, the parameter can be of the number, date, or text type. When you use two parameters, the parameters can only be of the text type. When you use three parameters, the parameters can only be of the text type.

    • In the format, the month must be uppercase MM, and the year must be lowercase yy or yyyy. The day must be lowercase dd.

    3. Example

    Formula

    Result

    Note

    TODATE(DATE(2007,12,12))

    Returns the date object of December 12, 2007.

    If the parameter is of the date type, the parameter will be directly returned.

    TODATE(1023542354746)

    Returns June 8, 2002.

    If the parameter is the number of milliseconds starting from 00:00:00 January 1, 1970 to the specific time, the function returns the corresponding time.

    TODATE("2007/10/15")

    Returns the date object of October 15, 2007.

    If the parameter is a text in date format, the function returns the corresponding date.

    TODATE("1/15/07","MM/dd/yy")

    Returns the date object of January 15, 2007. (MM must be uppercase.)

    The function contains two parameters. The first parameter is a text in the date format, and the second parameter is the format used to parse the date.

    In particular, yyyyMMdd is used to parse date formats such as 20081230. For example, TODATE("20110830",   "yyyymmdd") returns the date August 30, 2011.

    TODATE("Monday1/15/07","EEEMM/dd/yy","en")

    Returns the date object of January 15, 2007. The string Monday can only be parsed normally using "en".

    The function contains three parameters. The first parameter is a text in the date format, the second parameter is the format used to parsed date, and the third parameter is the language used in parsing the date, for example, zh (Chinese)   and en (English). If EEE and MM/dd/yy are inconsistent, MM/dd/yy takes precedence.

    The third parameter also supports uppercase formats ZH and EN.

    Real-Time Data

    1. Overview

    Syntax

    TODATE()

    Converts parameters in various date formats to date type.

    2. Notes

    • The function supports four types of parameter.

    • The function allows you to use only one parameter, which can be of the numeric, date, or text type. The function also allows you to use two parameters, both of which need to be of the text type.

    • In the format, the month must be uppercase MM, and the year must be lowercase yy or yyyy. The day must be lowercase dd.

    3. Example

    Formula


    Note

    TODATE(DATE(2007,12,12))

    Returns the date object of December 12, 2007.

    If the parameter is of the date type, the parameter will be directly returned.

    TODATE(1023542354746)

    Returns June 8, 2022.

    If the parameter is   the number of milliseconds starting from 00:00:00 January 1, 1970 to the specific time, the function returns the corresponding time.

    TODATE("2007-06-08")

    Returns the date object of June 8, 2007.

    If the parameter is a text in date format, the function returns the corresponding date.

    TODATE("1/15/07","MM/dd/yy")

    Returns the date object of January 15, 2007. (MM must be uppercase.)

    The function contains two parameters. The first parameter is a text in the date format, and the second parameter is the format used to parse the date.

    In particular, yyyyMMdd is used to parse date formats such as 20081230. For example, TODATE("20110830","yyyymmdd") returns the date August 30, 2011.

     


    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy