Dates are good at looking finished. There's an input, a value goes into the database, and the page displayed it in a familiar format.

The questions tend to arrive later. Why did the date move back a day? Why is the weekly appointment an hour out? What exactly does the end of the month mean for this report?

Before choosing a column type for a date picker, I want to know what the value represents. Three things that look quite similar on a form can have need very different treatment.

A calendar date belongs on a calendar

A birthday is usually a calendar date. The person entering it means a particular day, month and year. They haven't supplied a time of day or asked us to convert it between time zones.

Turning that value into midnight in one zone and displaying it in another can shift the visible date. The application may have performed a valid time conversion while losing the meaning of the original input.

I'd preserve the date as a date and choose its display format separately. A due date can need the same treatment, although I'd first ask whether the business actually means a specific cutoff time.

That's a requirements question work answering before the field appears in several forms and exports.

An event has a position in time.

For something that has already happened, such as a record being created, I usually want an unambiguous instant. A UTC timestamp is a useful representation of that, with conversion when the application displays it to somebody in a particular zone.

I'd still make the display zone clear where it affects interpretation. Two people looking at the same event can reasonably see different local times.

Reports need a decision too. If someone asks for everything that happened on Monday, whose Monday are we using? For a business report, I might calculate the start and end of that day in the business's time zone, then compare the corresponding instants against stored timestamps.

I'd use the next day's boundary as the exclusive end of that range. That avoids trying to invent a final fractional second that matches the database's precision.

An appointment carries local meaning

A recurring appointment at 9am in London brings another requirement. The local clock time may be part of the promise, even when the UTC offset changes during the year. A fixed offset on its own doesn't describe the rules of a named time zone. I'd want the appointments meaning and zone represented clearly enough to calculate each occurrence.

A fixed offset on its own doesn't describe the rules of a named time zone. I'd want the appointment's local meaning and zone represented clearly enough to calculate each occurrence.

The clock changes also create local times that don't exist and times that occur twice. If the application allows appointments in those hours, it needs a policy for them. I'd rather show the person an understandable choice than let a library's default quietly decide what they meant.

Be precise about adding a day

A calendar day and 24 elapsed hours can produce different results around a clock change. PHP's date and time arithmetic examples show why the operation you choose matters.

I want a requirement such as same local time tomorrow or exactly 24 hours after creation. Those phrases give me something concrete to implement and test.

Month boundaries deserve similar care. A monthly recurrence needs a rule for a day that the next month doesn't contain. That decision belongs in the feature's behaviour, where we can explain it to the person using it.

For tests, I'd choose explicit dates and zones, including cases around both clock changes. I'd also check month ends and year boundaries wherever the feature crosses them.

The date library can do a lot to eh calculation. I still need to decide what the value means before asking it to calculate anything.