Notification

This article is about Looker Studio. For Looker documentation, visit https://cloud.google.com/looker/docs/intro.

Trang bạn đã yêu cầu hiện không có sẵn bằng ngôn ngữ của bạn. Bạn có thể chọn ngôn ngữ khác ở cuối trang hoặc dịch nhanh mọi trang web sang ngôn ngữ mà bạn chọn bằng cách sử dụng tính năng dịch được tích hợp sẵn trong Google Chrome.

SECOND

Returns the seconds component of a given date.

Sample usage

SECOND(Date)

Syntax

1) Returns the seconds component from a Date & Time value.

SECOND(date_expression)

2) Returns the seconds component from a compatibility mode Date value.

SECOND(X [,format_string])

Parameters

  • date_expression - a Date & Time field or expression.
  • X - a field or expression that evaluates to Text, Number, or compatibility mode Date.
  • format_string - format for X. Optional if X is correctly configured as a semantic date field.

Format strings for compatibility mode dates

Supported date functions accept the following input formats if X is a Text field or expression, or compatibility mode Date:

  • Any valid strptime format is accepted.
  • 'BASIC': %Y/%m/%d-%H:%M:%S
  • 'DEFAULT_DASH': %Y-%m-%d [%H:%M:%S]
  • 'DEFAULT_SLASH': %Y/%m/%d [%H:%M:%S]
  • 'DEFAULT_DECIMAL': %Y%m%d [%H:%M:%S
  • 'RFC_1123': for example, Sat, 24 May 2008 20:09:47 GMT
  • 'RFC_3339': for example, 2008-05-24T20:09:47Z
  • 'DECIMAL_DATE': same as 'DEFAULT_DECIMAL'

Supported time functions accept the following input format if X is a Number field or expression:

  • 'SECONDS': seconds since Epoch
  • 'MILLIS': milliseconds since Epoch
  • 'MICROS': microseconds since Epoch
  • 'NANOS': nanoseconds since Epoch
  • 'JULIAN_DATE': days since Epoch

Examples

Example formula Input Output
SECOND(Date) Jan 1, 2019 0
SECOND(Date as Text, 'BASIC') 2019/01/01-09:40:45 45
SECOND(Date as Number, 'SECONDS') 1561784874 54

SECOND(Date as lots of Numbers, 'MILLIS')

1562004058620 59

Notes

This function works with both compatibility mode dates and upgraded Date and Date & Time data types.

Thông tin này có hữu ích không?

Chúng tôi có thể cải thiện trang này bằng cách nào?
true
What's new in Looker Studio?

Learn about new features and recent changes. Looker Studio release notes live on Google Cloud.

Search
Clear search
Close search
Main menu
16658516806476542307
true
Tìm kiếm trong Trung tâm trợ giúp
true
true
true
true
true
102097
false
false