Date display styles

  • Last update:  2021-04-01
  • I. Description

    In our daily report design, one of the most commonly used widgets is the "Date" widget, but because of the various needs, the form of time display is also different.

    Here, I would like to share some known display forms with you, and welcome you to add documents.

    II. Show time of day

    In the Attribute> Widget Value of the date widget, define the formula as =today() to customize the end time to the current day, as shown in the following figure:

    1.png

    III. Show custom year

    1) Method 1:

    Click the cell, right-click and select Attributes>Display>Data Dictionary, or use the range() function in the cell Attributes>Display>Data Dictionary on the right to display the year, save the template, click Preview on the PC, and the return result is 2017. As shown below:

    2.png

    2) Method 2:

    For example, the date field in our database is 2017-01-01, when we only want to use the year, there are two ways:

    • LEFT() function: input =LEFT(2017-01,4) in the cell, intercept 4 from the left as a string, and the return value is 2017.

    • YEAR() function: enter =YEAR('2017-01-01') in the cell, return the year in the date, and the return value is 2017.

    IV. Get the current time

    Get the year, month, and day of the date through the three functions: year(), month(), and day().

    • Get the current year: enter =year(now()) in the cell to return the result 2017.

    • Get the current month: enter =month(now()) in the cell to return the result 02.

    • Get the current day: input =day(now()) in the cell to return the result 14.

    Note: If year(), month(), day() correspond to year\month\day with decimals, it will return the current year or month or day, which is equivalent to year(today()), month(today()), day(today()).

    V. Return the Chinese week number of the date

    The four functions of FORMAT(), SWITCH(), WEEKDAY() and DATE() can be used to return the Chinese week number of the date.

    • Enter =FORMAT(DATE(2017,03,06), "EEEEE") in the cell to return the result: Monday.

    • Enter =SWITCH(WEEKDAY(DATE(2017,03,06)),1,'Monday',2,'Tuesday',3,'Wednesday',4,'Thursday',5,'Friday',6,'Saturday',0,'Sunday') in the cell return result: Monday.

    VI. Special format conversion of date

    Use the FORMAT() function for format conversion.

    • Current year, month, day and week: Enter =FORMAT(today(),"yyyy year MM month dd day EEEEE") in the cell, and the result will be returned: Friday, December 25, 2020.

    • Current year: enter =FORMAT(today(),"yyyyyear") in the cell, and the result will return: 2020.


    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    10s後關閉

    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