1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! PHP date patterns for Rust.
//!
//! [`PhpDatePattern`] formats like `DateTime::format()` and parses like `DateTime::createFromFormat()`, in English,
//! with [`PhpDateTime`] and [`Zone`] for time zones. [`formats`] resolves which pattern applies from a
//! [`DateConfig`] and exports patterns to Day.js.
//!
//! ```
//! use php_dates::{PhpDatePattern, PhpDateTime, Zone};
//!
//! let pattern = PhpDatePattern::compile("d/m/Y H:i T")?;
//! let madrid = Zone::parse("Europe/Madrid").ok_or("unknown zone")?;
//! let date = PhpDateTime::new(jiff::civil::date(2026, 7, 1).at(8, 30, 0, 0), madrid)?;
//! assert_eq!(pattern.format(&date), "01/07/2026 08:30 CEST");
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! [`jiff`] is re-exported: its types are part of this crate's API. The `tzdb-bundle` feature builds the time zone
//! database into the binary, for systems without one.
pub use ;
pub use ;
pub use ;
/// The date library whose types this crate takes and returns.
pub use jiff;
pub use ParseError;
pub use PhpDatePattern;
pub use ;
/// The examples of the README are compiled and run as tests.
;