> For the complete documentation index, see [llms.txt](https://docs.panther.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.panther.com/ko/pantherflow/functions/date-time.md).

# 날짜/시간 함수

{% hint style="info" %}
PantherFlow는 Panther 버전 1.110부터 오픈 베타로 제공되며, 모든 고객이 이용할 수 있습니다. 버그 보고 및 기능 요청은 Panther 지원 팀에 공유해 주세요.
{% endhint %}

## `time.add()`

`time.add(timestamp: timestamp, value: int, unit: string) -> timestamp`

Return `timestamp` 조합하여 생성된 timespan에 더해지는 `값` 시간과 `단위`, 예: `"hour"`. `값` 직접 timespan 상수를 더하는 것보다 더 표현력 있는 타임스탬프 산술을 허용하는 열일 수 있습니다. 뺄셈은 음의 `값`. `단위` 다음과 같을 수 있습니다:

* `year`, `y`
* `month`
* `day`, `d`
* `hour`, `h`
* `minute`, `m`
* `second`, `s`

더 많은 값이 허용될 수 있지만, 향후 릴리스에서 지원된다는 보장은 없습니다.

**예:**

```kusto
let timebins =
range N from 1 to 10 step 1
| project t1=time.add(time.now(), N, 'day')
```

## `time.ago()`

`time.ago(span: timespan) -> timestamp`

다음인 타임스탬프를 반환합니다 `span` 전.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
```

## `time.diff()`

`time.diff(unit: string, timestamp1: timestamp, timestamp2: timestamp) -> int`

요청된 날짜 또는 시간 단위를 기준으로 두 타임스탬프의 차이를 계산합니다. 이 함수는 timestamp1을 timestamp2에서 뺀 결과(즉, timestamp2 - timestamp1)를 반환합니다. `단위` 다음과 같을 수 있습니다:

* `year`, `y`
* `month`
* `day`, `d`
* `hour`, `h`
* `minute`, `m`
* `second`, `s`

더 많은 값이 허용될 수 있지만, 향후 릴리스에서 지원된다는 보장은 없습니다.

**예:**

```kusto
panther_logs.public.aws_alb
| extend hoursToParse=time.diff('h', p_event_time, p_parse_time)
| extend minutesToParse=time.diff('m', p_event_time, p_parse_time)
| project hoursToParse, minutesToParse
```

## `time.now()`

`time.now() -> timestamp`

현재 타임스탬프를 반환합니다.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.now() - 1d
```

## `time.parse_timespan()`

`time.parse_timespan(str: string) -> timespan`

기간 문자열의 timespan 표현을 반환합니다.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.now() - time.parse_timespan('24h')
```

## `time.parse_timestamp()`

`time.parse_timestamp(str: string) -> timestamp`

타임스탬프 문자열의 타임스탬프 표현을 반환합니다.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.parse_timestamp('2023-01-01T00:00:00')
```

## `time.slice()`

`time.slice(time: timestamp, slice_length: int, slice_unit: string) -> timestamp`

다음인 타임스탬프를 반환합니다 `time` 에 속합니다. 다음 크기의 `slice_unit` 및 `slice_length`. 예를 들어 `slice_length` 이 1이고 `slice_unit` 가 "hour"이면, 시간은 속한 시간 단위까지 잘립니다. 슬라이스는 1970년 1월 1일 자정 기준으로 계산됩니다. `slice_unit` 다음과 같을 수 있습니다:

* `year`, `y`
* `month`
* `day`, `d`
* `hour`, `h`
* `minute`, `m`
* `second`, `s`

더 많은 값이 허용될 수 있지만, 향후 릴리스에서 지원된다는 보장은 없습니다.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| summarize count=agg.count() by bucket=time.slice(p_event_time, 10, 'm')
| sort bucket asc
| visualize
```

## `time.trunc()`

`time.trunc(unit: string, timestamp: timestamp) -> timestamp`

지정된 단위로 잘린 타임스탬프를 반환합니다. `단위` 다음과 같을 수 있습니다:

* `year`, `y`
* `month`
* `day`, `d`
* `hour`, `h`
* `minute`, `m`
* `second`, `s`

더 많은 값이 허용될 수 있지만, 향후 릴리스에서 지원된다는 보장은 없습니다.

**예:**

```kusto
panther_logs.public.aws_alb
| where p_event_time > time.ago(1d)
| extend minuteEventHappened=time.trunc('m', p_event_time)
| summarize eventsPerMinute=agg.count() by minuteEventHappened
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.panther.com/ko/pantherflow/functions/date-time.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
