# toStartOfDay and toDateTimeAtStartOfDay: examples

URL: https://goingstellar.ro/reference/smart-values/tostartofday/

These functions change only the time part of a date. toStartOfDay sets it to 00:00, toCurrentTime sets it to the time of the run, and the toDateTimeAt versions do the same in a time zone you name. Use them to compare dates by day or to build a clean start-of-day value.

## Syntax

```
{{[date].toStartOfDay}}
{{[date].toCurrentTime}}
{{[date].toDateTimeAtStartOfDay("zone")}}
{{[date].toDateTimeAtCurrentTime("zone")}}
```

## Arguments

- `zone` (required: no): A time zone id such as Australia/Sydney, or a user's timeZone value

## Works on

- Fields: now, created and other date-time values
- Returns: the same day with the time replaced

## Examples

```
{{now.toStartOfDay}}
```

Today at midnight UTC.

Result:

```
2026-11-29T00:00:00.0+0000
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.toCurrentTime}}
```

Keeps the date and sets the time of the run.

Result:

```
2026-11-29T16:02:38.6+0000
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.created.toStartOfDay.format("yyyy-MM-dd HH:mm")}}
```

Strips the time from the creation date before formatting.

Result:

```
2026-11-29 00:00
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.toStartOfDay.plusDays(1)}}
```

Tomorrow at midnight, a clean upper bound for a day window.

Result:

```
2026-11-30T00:00:00.0+0000
```

Run on Jira Cloud on 29 Nov 2026.

```
{{issue.created.toDateTimeAtStartOfDay("Australia/Sydney")}}
```

Midnight of the creation day in Sydney, shown with the +1100 offset.

Result:

```
2026-11-29T00:00:00.0+1100
```

Run on Jira Cloud on 29 Nov 2026.

```
{{now.toDateTimeAtStartOfDay(issue.reporter.timeZone)}}
```

Midnight in the reporter's own time zone, which came out as +0200.

Result:

```
2026-11-29T00:00:00.0+0200
```

Run on Jira Cloud on 29 Nov 2026.

## Pitfalls

- The docs examples pass the word `timezone` without quotes. Run as written, `toDateTimeAtStartOfDay(timezone)` and `toDateTimeAtCurrentTime(timezone)` still rendered, and the start of day stayed at +0000 (checked on Jira Cloud, November 2026). Treat it as a placeholder, not a keyword.
- An invalid zone does not fail. `toDateTimeAtStartOfDay("Nope/Zone")` rendered a normal +0000 date (checked on Jira Cloud, November 2026), so a typo in a zone id goes unnoticed.
- These work on dates with a time. `{{issue.duedate.toStartOfDay}}` and `{{issue.duedate.toCurrentTime}}` rendered empty because a due date is date-only (checked on Jira Cloud, November 2026).
- Parentheses on the plain forms are accepted: `{{now.toStartOfDay()}}` renders the same as without them.

## Related

- [setTimeZone() and convertToTimeZone()](https://goingstellar.ro/reference/smart-values/date-timezone/)
- [withDayOfMonth(), withMonth() and other with… setters](https://goingstellar.ro/reference/smart-values/date-with/)
- [startOfMonth and endOfMonth](https://goingstellar.ro/reference/smart-values/startofmonth-endofmonth/)
- [plusDays() / minusDays() and other units](https://goingstellar.ro/reference/smart-values/date-plus-minus/)
- [isAfter(), isBefore(), isEquals(), compareTo()](https://goingstellar.ro/reference/smart-values/date-compare/)
- [toDate (text to date)](https://goingstellar.ro/reference/smart-values/todate/)

## Sources

- [Jira smart values: date and time (Atlassian Support)](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/)

