> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Automatic shift matching

> Learn how DingTalk attendance automatic shift matching works with two methods—Match by clock-in time and Match by clock-in and clock-out time—covering rotating shifts, overnight shifts, and same-day shifts.

Automatic shift matching provides two methods: Match by clock-in time and Match by clock-in and clock-out time. See the examples below.

## 1. Match by clock-in time

Matches the shift based on the employee's **first clock-in**. Use this method for rotating shifts and overnight shifts.

<Note>
  **Example:** An attendance group has a day shift from 08:00 to 20:00 and a night shift from 20:00 to 08:00 the next day, with the automatic matching window set to 2 hours before each shift starts. If an employee clocks in between 06:00 and 08:00, the system matches them to the day shift. If they clock in between 18:00 and 20:00, the system matches them to the night shift.
</Note>

<Frame>
  <img src="https://alidocs.oss-cn-zhangjiakou.aliyuncs.com/res/7jP2lR6o8G83l8g5/img/fdc26771-a90f-4321-9db3-1df3be2e4b31.png" alt="Match by clock-in time" />
</Frame>

## 2. Match by clock-in and clock-out time

Matches the shift based on the employee's **first clock-in and last clock-out**. Use this method for same-day shifts that share the same start time.

<Note>
  **Example:** An attendance group has a long day shift from 08:00 to 20:00 and a regular day shift from 08:00 to 17:00. If an employee clocks in at 07:50 and out at 18:30 on the same day, the system matches them to the regular day shift.
</Note>

<Frame>
  <img src="https://alidocs.oss-cn-zhangjiakou.aliyuncs.com/res/7jP2lR6o8G83l8g5/img/cfc48db2-b951-4774-ac64-fecddbe9800a.png" alt="Match by clock-in and clock-out time" />
</Frame>
