---
title: Always Run Tests with TZ=UTC
impact: MEDIUM
impactDescription: Prevents timezone-related test failures
tags: testing, timezone, consistency
---
## Паспорт документа

- Статус документа: living standard
- Актуально на: 28 марта 2026 года
- Владелец: backend/platform-команда
- Пересмотр: при изменении инженерной практики, CI/CD, архитектурных правил или локального workflow
- Область применения: внутренние rule/reference-card документы для инженерной команды
- Связанные документы:
  - [Индекс Agents](../README.md)
  - [Команды разработки](../commands.md)
  - [Инженерные принципы](../../governance/engineering-principles.md)

## Always Run Tests with TZ=UTC

**Impact: MEDIUM**

Tests must produce consistent results regardless of the developer's local timezone. Set `TZ=UTC` for all test commands.

```bash
# In package.json scripts
"test": "TZ=UTC vitest run",
"test:watch": "TZ=UTC vitest",
"test:e2e": "TZ=UTC jest --config ./test/jest-e2e.json"
```

### In Test Code

```typescript
// Good — explicit timezone in tests
const date = new Date('2026-03-12T10:00:00Z'); // Always UTC

// Bad — ambiguous timezone
const date = new Date('2026-03-12 10:00:00'); // Depends on local TZ
```

Uzbekistan is UTC+5. When testing time-dependent features (schedules, availability), always use explicit UTC timestamps and convert in assertions.
