# `FUN_GET_DATE_UKT` (function)

> 根据传入时间获取时间


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_tCStartTime` | `varchar(200)` |
| 2 | IN | `p_sStartDate` | `varchar(200)` |
| 3 | IN | `p_sEndDate` | `varchar(200)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTION `FUN_GET_DATE_UKT`'`._

## Narrative

**Business context:** 生产排程 → 生产计划管理 → 生产管理 — within-day rest-period shifter used by the workcenter-scheduling time engine. Companion to `FUN_GET_DATE_KT` for rest windows that do NOT cross midnight (lunch 午休, afternoon tea 午茶, dinner 晚餐, etc.). Default window 11:30–12:30.

**What it does:** checks whether `p_tCStartTime` sits between `start_today` and `end_today`; if yes, jumps it forward to `end_today`. Otherwise returns the input unchanged. NULL-safe via `IFNULL` defaults.

**Invocation:** called from `Sp_Manufacture_SetTimeDivRow`, `Sp_Manufacture_SetTime_BB`, `Sp_Manufacture_SetTime_Employ`, `Sp_Manufacture_SetTime_process`, and the helper `FUN_GET_CALCPLAN_DATE_END`. Day-shift branch passes it the lunch/breakfast/dinner window pairs (`p_sWxStartDate`/`p_sWxEndDate`, etc.) one after another to skip whichever rest period the cursor falls in. Reached via `BtnCalculationService` "计算排程时间" button.
