format-date

The format-date operation converts a given date string into a specified format. This is useful when normalizing dates for APIs, reports, or user-facing outputs.

How it works

  • Input – the original date as a string (e.g. 2024-02-21 15:30:00).
  • Format pattern – the desired format string, based on the DateTime formatting standard.
  • Result – the date reformatted according to the pattern. If the input cannot be parsed as a valid date, the original value is returned unchanged.

Examples

InputFormat PatternOutput
2024-02-21d.m.Y21.02.2024
2024-02-21 15:30:00Y-m-d H:i2024-02-21 15:30
invalid dated.m.Yinvalid date

Common Format Patterns

  • Y-m-d → 2024-02-21 (ISO format)
  • d.m.Y → 21.02.2024 (European style)
  • m/d/Y → 02/21/2024 (US style)
  • Y-m-d H:i:s → 2024-02-21 15:30:00 (full timestamp)
  • l, j F Y → Wednesday, 21 February 2024 (long text form)

Usage in PalDock

Use format-date when you need to:

  • Convert system-generated dates into the format required by an external API.
  • Display user-friendly date formats in outputs.
  • Standardize dates for reporting and exports.
  • Strip time information (e.g. from Y-m-d H:i:s to Y-m-d).

⚠️ Always put the prefix “@” before the date format.

Best Practices

  • Always use clear and unambiguous formats when passing dates between systems.
  • Be mindful of time zones – format-date only reformats the string, it does not adjust the timezone unless combined with other operations.
  • Validate date strings before formatting to avoid passing invalid data.
  • Stick to ISO 8601 (Y-m-d H:i:s) for machine-to-machine integrations, unless the external system specifies otherwise.

References

https://www.php.net/manual/en/datetime.format.php

Insights that
helps you grow

  • Release notes 2025/12/19
    We added country-based categorization. You can now categorize offers, integrations, and other items by a specific country, or keep them global across all markets. We also…
  • Release notes 2025/12/17
    More flexible lead rejection: based on validation rules, filters, or pingtree sales results, by source (iframe, API) or by partner (include / exclude). It is now possible to…
  • Case study: How Lender Orka Ventures Scaled Affiliate Operations
    Orka Ventures, an online lending group that wanted to scale fast across countries and onboard affiliates quickly. Their custom affiliate API and tracking layer soon…