Skip to content

Dates and Time Zone

ISO 8601 standard

Whole API Pontotel uses the format ISO 8601 to represent dates and times.

Accepted Formats

Date and Time with Fuse

Text Only
1
2
3
YYYY-MM-DDTHH:MM:SS±HH:MM

Exemplo: 2025-01-31T08:00:00-03:00
Part Description Example
YYYY Year with 4 digits 2025
MM Month (01-12) 01
DD Day (01-31) 31
T Compulsory separator T
HH:MM:SS Time, minute, second 08:00:00
±HH:MM Zone Offset -03:00

Data Only

Text Only
1
2
3
YYYY-MM-DD

Exemplo: 2025-01-31

Used for fields like data_admissao, data_inicio_ferias, etc.

UTC (Zero offset)

Text Only
2025-01-31T11:00:00Z

O Z equals +00:00 (UTC).

Time Zone

Always tell the time zone

In date/time fields, Always inform the time zone offset. The absence of the spindle can generate markings at incorrect times.

Common Fuses in Brazil

Region Offset Example
Brasília (BRT) - 03:00. 2025-01-31T08:00:00-03:00
Acre (ACT) - 05:00 2025-01-31T06:00:00-05:00
Fernando de Noronha - 02:00. 2025-01-31T09:00:00-02:00

Internal Consistency

Pontotel stores all times in UTC internally, but returns the values with the original spindle reported in the employer's registration.

Practical Examples in Requests

Filter Period Markings

HTTP
GET /marcacoes/?data_inicio=2025-01-01T00:00:00-03:00&data_fim=2025-01-31T23:59:59-03:00

Create correct spindle marking

JSON
1
2
3
4
5
{
  "empregado_id": 123,
  "data_hora": "2025-01-31T08:05:00-03:00",
  "tipo": "entrada"
}

Code Handling

Python
1
2
3
4
5
6
7
8
9
from datetime import datetime
import pytz

# Criar datetime com fuso de Brasília
brasilia = pytz.timezone("America/Sao_Paulo")
agora = datetime.now(brasilia)

# Formatar para API
data_hora = agora.isoformat()  # "2025-01-31T08:05:00-03:00"

==="JavaScript"

JavaScript
1
2
3
4
5
6
7
// Usar biblioteca date-fns-tz para fusos
import { formatISO } from 'date-fns';
import { toZonedTime } from 'date-fns-tz';

const timeZone = 'America/Sao_Paulo';
const date = toZonedTime(new Date(), timeZone);
const dataHora = formatISO(date); // "2025-01-31T08:05:00-03:00"

Next Steps