<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@easyops-cn/brick-next-pipes](./brick-next-pipes.md) &gt; [parseTimeRange](./brick-next-pipes.parsetimerange.md)

## parseTimeRange() function

解析一个时间字符串。

 Datetime

**Signature:**

```typescript
export declare function parseTimeRange(value: string): number;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  value | string | 时间字符串。 |

**Returns:**

number

解析后的时间戳，如果输入为空返回当前的时间戳。

## Remarks

`now/d` 将被转换为当天开始时的时间戳。

`now/y` 将被转换为当年开始时的时间戳。

`now-{n}d` 将被转换为 `n` 天前的时间戳。

