Skip to content

Spain's daily record of working time

The rule

Every employer in Spain keeps a daily record of each person’s working time (registro de jornada):

  • for each day, the exact time work started and ended, for each person;
  • breaks and split days shown, so the hours worked can be told;
  • kept for four years, and available to the person, their representatives and the labour inspectorate.

Who uses it

Employers in Spain; anyone asked for a record of each day’s start and end of work.

How the recipe does it

The package (package.toml) has one layer, and the record is the export standard/daily_record writes:

[[layer]]
id = "jornada"
settings = { categories = { lunch = "lunch" } }
{ "uses": "standard/daily_record", "params": { "id_attribute": "dni", "categories": ["work", "overtime"] } }
  • The punches are the record’s source: each in and out as punched, the corrections recorded on them kept with who made them and when.
  • A lunch punched out and back in is allocated to lunch (not worked): the day’s record shows its stretches of work either side of it.
  • daily_record writes a row for each stretch of work: the person (their id in the employment attribute id_attribute, a DNI), the workday, its start and end as wall times with their offset in the zone of the day (2026-10-05T09:00:00+02:00), and its hours. Lines of the categories named that follow on from each other (work, then overtime) are one stretch. A night the clocks change in shows each end at its own offset.
  • An export is run for a pay period (POST .../exports) and kept with what it wrote; the facts and closed periods it comes from are kept for as long as the tenant is, so a record can be written again at any time the four years ask for.

Parameters

ParameterMeaning
id_attributeThe employment attribute holding the person’s id in the record.
categoriesThe categories of work recorded (default every category of lines from punches).

What the scenarios show

  • each-day-its-start-its-end-and-its-breaks: two stretches either side of lunch, and a day of one.
  • the-night-the-clocks-go-back: started at +02:00, ended at +01:00.
  • overtime-is-part-of-the-day: 10 hours, 2 of them overtime, in one stretch.

This is a common way to keep the daily record; check the rules where you operate. Rules change and vary by collective agreement: how the record is kept and shown, how breaks are recorded, and the rules for part-time workers (whose record is monthly as well).

Get the recipe

The recipe’s package and its scenarios are in the example packages repository: attendance/spain_daily_record. Test it, or your own copy of it, with hourctl attend test, and publish it with hourctl attend pkg publish.

The policy package

The package’s layers, with the standard steps each one runs and their settings:

spain_daily_record/package.toml
name = "spain_daily_record"
version = "1.0.0"
description = "Spain's daily record of working time (registro de jornada): for each person and day, when work started and ended, its breaks and hours, from the punches as worked, kept and exported for an inspection."
# Lunch punched out and back in is allocated to lunch (not worked, not
# paid), so the day's record shows its stretches of work either side.
# The record itself is the export standard/daily_record writes, of the
# lines of work and overtime.
[[layer]]
id = "jornada"
settings = { categories = { lunch = "lunch" } }

Scenarios

Each scenario gives a person’s punches and setup and the timecard they must produce, worked out with this package adopted (the format).

Monday from 09:00 to 18:00 with an hour's lunch, and Tuesday from 08:00 to 15:00: each stretch of work a row, as it started and ended in Madrid's time with its offset, and its hours; the person by their DNI
scenarios/each-day-its-start-its-end-and-its-breaks.toml
description = "Monday from 09:00 to 18:00 with an hour's lunch, and Tuesday from 08:00 to 15:00: each stretch of work a row, as it started and ended in Madrid's time with its offset, and its hours; the person by their DNI"
punch = [
{ at = "2026-10-05 09:00", kind = "in" }, { at = "2026-10-05 14:00", kind = "lunch_start" },
{ at = "2026-10-05 15:00", kind = "lunch_end" }, { at = "2026-10-05 18:00", kind = "out" },
{ at = "2026-10-06 08:00", kind = "in" }, { at = "2026-10-06 15:00", kind = "out" },
]
[policy]
zone = "Europe/Madrid"
[[category]]
id = "lunch"
worked = false
paid = false
[[employment]]
effective = "2024-01-08"
kind = "hired"
attributes = { dni = "12345678Z" }
[expect.export]
uses = "standard/daily_record"
params = { id_attribute = "dni", categories = ["work", "overtime"] }
day = "2026-10-05"
file = "person,date,start,end,hours\n12345678Z,2026-10-05,2026-10-05T09:00:00+02:00,2026-10-05T14:00:00+02:00,5.00\n12345678Z,2026-10-05,2026-10-05T15:00:00+02:00,2026-10-05T18:00:00+02:00,3.00\n12345678Z,2026-10-06,2026-10-06T08:00:00+02:00,2026-10-06T15:00:00+02:00,7.00\n"
A day of 10 hours whose last 2 are overtime: the work and the overtime follow on from each other, and the day is one stretch of 10 hours
scenarios/overtime-is-part-of-the-day.toml
description = "A day of 10 hours whose last 2 are overtime: the work and the overtime follow on from each other, and the day is one stretch of 10 hours"
punch = [
{ at = "2026-10-05 08:00", kind = "in" }, { at = "2026-10-05 18:00", kind = "out" },
]
[policy]
zone = "Europe/Madrid"
[[category]]
id = "lunch"
worked = false
paid = false
[[employment]]
effective = "2024-01-08"
kind = "hired"
attributes = { dni = "12345678Z" }
[[layer]]
id = "daily"
[[layer.step]]
id = "daily"
uses = "standard/threshold"
params = { over = "8h", to = "overtime" }
[expect.export]
uses = "standard/daily_record"
params = { id_attribute = "dni", categories = ["work", "overtime"] }
day = "2026-10-05"
file = "person,date,start,end,hours\n12345678Z,2026-10-05,2026-10-05T08:00:00+02:00,2026-10-05T18:00:00+02:00,10.00\n"
A night from 22:00 on Saturday 24 October 2026 to 06:00, the clocks going back at 03:00: one stretch of 9 hours, started at +02:00 and ended at +01:00
scenarios/the-night-the-clocks-go-back.toml
description = "A night from 22:00 on Saturday 24 October 2026 to 06:00, the clocks going back at 03:00: one stretch of 9 hours, started at +02:00 and ended at +01:00"
punch = [
{ at = "2026-10-24 22:00", kind = "in" }, { at = "2026-10-25 06:00", kind = "out" },
]
[policy]
zone = "Europe/Madrid"
[[category]]
id = "lunch"
worked = false
paid = false
[[employment]]
effective = "2024-01-08"
kind = "hired"
attributes = { dni = "12345678Z" }
[expect.export]
uses = "standard/daily_record"
params = { id_attribute = "dni", categories = ["work", "overtime"] }
day = "2026-10-19"
file = "person,date,start,end,hours\n12345678Z,2026-10-24,2026-10-24T22:00:00+02:00,2026-10-25T06:00:00+01:00,9.00\n"