
A Contact Form 7 integration may receive an inquiry timestamp, a date-only appointment preference and a CRM response time in the same workflow. Those values have different meanings. Choosing a date library helps implement a contract, but it cannot recover a missing timezone or decide whether an answer describes a calendar day or an instant.
date-fns, Day.js, Luxon, Pendulum and Carbon are five choices for custom adapter code. This comparison uses official documentation and licenses checked October 27, 2026. None is a verified native CF7 connector, a scheduling service or an automatic dependency of CF7 Analytics. We have not run a comparative speed, accuracy or bundle-size benchmark.
Classify the value before choosing an API
Separate an absolute instant, a local wall time with an explicit zone, and a date without a time. Preserve the source representation where your retention policy permits it, together with the interpretation your adapter applies. A preferred service date should not acquire a midnight UTC meaning simply because the receiving language has a convenient datetime constructor.
For timestamps exchanged between systems, prefer a documented representation that identifies the instant, such as a timestamp with an offset. Where the business rule depends on a named timezone, preserve that zone as well. An offset describes one relationship to UTC; a zone supplies rules that can vary over time. Our reporting-timezone guide covers period boundaries; this article compares implementation choices.
Five-library decision table
| Library | Runtime and model | Useful fit | Boundary to review |
|---|---|---|---|
| date-fns | JavaScript functions with native Date compatibility | Function-oriented transformation code | Explicit timezone package and context |
| Day.js | JavaScript wrapper with plugins | Chainable APIs in a reviewed plugin setup | Strict parsing and UTC/timezone dependencies |
| Luxon | JavaScript DateTime objects | Visible zone and parsing operations | Invalid results and runtime zone support |
| Pendulum | Python datetime-oriented API | Python-owned lead workers | Default zone and parsing assumptions |
| Carbon | PHP DateTime and DateTimeImmutable extensions | PHP-owned adapters | Mutable versus immutable object choice |
The compared library cores are MIT-licensed and do not require a paid hosted plan. Verify package and dependency licenses for your selected version. Operational costs still include development, runtime updates, timezone-data maintenance and checking results after upgrades. A commercial support arrangement, if separately chosen, is not part of this core-library comparison.
date-fns
date-fns provides modular JavaScript functions for date operations and works with the native Date model. Its function-oriented style can fit an adapter that keeps parsing, validation, transformation and formatting as separate stages rather than passing a chainable object through the application.
Strength: a team can select the operations it needs and keep transformation steps explicit. The current official timezone package, @date-fns/tz, provides zone-aware Date extensions. That is relevant when an adapter must calculate in a business zone instead of the worker host’s local zone.
Limitation: native Date compatibility does not eliminate implicit system-zone behavior. Review the actual timezone package, supported API and context used by every operation. Do not copy examples from a different major version or assume that importing a formatter supplies the intended zone everywhere.
Choose date-fns when your JavaScript team prefers explicit utility functions and will own the zone contract. Its MIT license is linked by the official repository. No library can turn a timezone-free source timestamp into a uniquely known instant without additional information.
Day.js
Day.js offers a chainable JavaScript style with additional capabilities supplied through plugins. The official string-and-format documentation distinguishes parsing with a specified format and strict matching. That is useful when a partner provides one controlled textual format rather than a general-purpose timestamp.
Strength: an adapter can keep a small, documented set of parsing and zone features. The timezone plugin adds named-zone operations and depends on the UTC plugin. Explicit initialization gives reviewers a concrete configuration to inspect.
Limitation: the required plugins must actually be present and extended in the running application. A permissive parse can accept input differently from a strict parse. Also distinguish conversion of an existing instant from interpreting a wall time in a zone; preserving the displayed clock time can change the instant.
Choose Day.js where a JavaScript team wants this API style and will test its plugin configuration. The core is MIT-licensed. Do not select it on an assumed performance advantage that your workload has not demonstrated.
Luxon
Luxon gives JavaScript code a DateTime-oriented API with explicit parsing and zone operations. Its parsing guide covers ISO representations and format-based parsing. That can make a receiving adapter readable when the code frequently moves between exchange timestamps and local display values.
Strength: the model encourages a team to inspect the parsed value and its zone before formatting. The official zone guide also explains the important difference between offsets and named zones. Keeping those operations visible helps a reviewer spot an accidental local-time assumption.
Limitation: accepting a string without an offset requires a deliberate zone policy. Review invalid results and the runtime’s support for the named zones your application needs. A formatted output that looks plausible is insufficient evidence that the underlying instant is correct.
Choose Luxon for a JavaScript-owned pipeline where explicit DateTime and zone handling fit the team’s conventions. Its license is MIT. It still needs source validation, error routing and a maintained business interpretation of date-only answers.
Pendulum
Pendulum serves Python applications with a datetime-oriented interface, named-zone handling, parsing and date arithmetic. Its documentation describes its relationship to Python’s native datetime types and makes default-zone behavior visible. That fits an integration worker already implemented in Python.
Strength: a Python team can keep parsing and transformation close to its existing validation and destination adapter. Named-zone construction and conversion are easier to review when they appear as deliberate operations rather than depending on the machine’s incidental timezone.
Limitation: a default of UTC in relevant constructors is still a policy choice, not proof that an ambiguous source value was originally UTC. Review the exact constructor and parser used. Code that changes a timezone label is not necessarily performing the same operation as code that converts an instant.
Choose Pendulum for a Python-owned worker when its API improves maintainability over the team’s existing datetime approach. Its license is MIT. Do not add another runtime to a PHP or JavaScript workflow solely to use it without a demonstrated need.
Carbon
Carbon extends PHP’s datetime classes. Its current introduction explicitly distinguishes Carbon, which extends DateTime, from CarbonImmutable, which extends DateTimeImmutable. That distinction matters when one timestamp is reused for several calculations in a lead adapter.
Strength: PHP developers can keep familiar datetime behavior and use a richer API for arithmetic, comparison and formatting. Choosing CarbonImmutable can help prevent a calculation for one report from altering a shared object used by another calculation.
Limitation: a mutable Carbon instance returns and changes the same object for modifying operations. Review the class actually instantiated instead of assuming all Carbon objects behave immutably. The reference also marks features that require additional packages; a calendar-oriented name is not evidence that business-hours rules are included automatically.
Choose Carbon for a maintained PHP adapter with explicit timezone and mutability conventions. Its core license is MIT. It does not configure WordPress site time, expose CF7 submissions or install a scheduling integration by itself.
Use the same acceptance cases across candidates
Start with a timestamp containing Z, another containing an explicit positive offset, a date-only answer, an impossible calendar date and an offset-free wall time. For each, write down whether the adapter should accept, reject or request more context. Do not score a parser for accepting more formats when the contract requires rejecting ambiguity.
Add daylight saving cases in the actual named zone: a local time that occurs twice and one that does not occur. Decide how the application resolves or rejects those states before evaluating a library. Then check that output formatting has not changed the represented instant. These are proposed acceptance cases, not reported results from a five-library test.
Finally, run the same fixtures after dependency and runtime upgrades. Pin the chosen package versions in the application, record changes in the adapter’s methodology, and distinguish a timezone-rule update from a change in your business policy. For a scheduled response workflow, also define whether “one day” means a calendar day or an elapsed duration.
Choose by runtime and explicit responsibility
Prefer date-fns for function-oriented JavaScript, Day.js for a reviewed plugin-based chainable API, Luxon for visible DateTime and zone operations, Pendulum for Python, or Carbon for PHP. The right choice is the one your team can maintain against a written date contract. A library shortlist cannot substitute for missing source information.
For submission trends in WordPress, inspect Svetlik Analytics for Contact Form 7, our free plugin. Its statistics are separate from these custom adapter libraries. Check actual timestamp availability in your source before designing exports, CRM transformations or response-time calculations.
