pub struct PhpDatePattern(/* private fields */);Expand description
A compiled PHP date pattern.
Implementations§
Source§impl PhpDatePattern
impl PhpDatePattern
Sourcepub fn compile(pattern: &str) -> Result<Self>
pub fn compile(pattern: &str) -> Result<Self>
Compile a PHP pattern.
§Errors
Returns [Error::InvalidArgument] for a token this port does not support.
Sourcepub fn format(&self, date: &NaiveDateTime) -> String
pub fn format(&self, date: &NaiveDateTime) -> String
Format a date and time.
Sourcepub fn parse(&self, value: &str) -> Option<NaiveDateTime>
pub fn parse(&self, value: &str) -> Option<NaiveDateTime>
Parse like DateTime::createFromFormat('!' . $format, $value) followed by the package’s
round-trip check: fields the pattern omits are the Unix epoch’s, and an invalid date, an
out-of-range part or text that does not read back identically is None.
Trait Implementations§
Source§impl Clone for PhpDatePattern
impl Clone for PhpDatePattern
Source§impl Debug for PhpDatePattern
impl Debug for PhpDatePattern
impl Eq for PhpDatePattern
Source§impl PartialEq for PhpDatePattern
impl PartialEq for PhpDatePattern
impl StructuralPartialEq for PhpDatePattern
Auto Trait Implementations§
impl Forget for PhpDatePattern
impl Freeze for PhpDatePattern
impl Move for PhpDatePattern
impl RefUnwindSafe for PhpDatePattern
impl Send for PhpDatePatternwhere
RawVecInner: Send,
impl Sync for PhpDatePatternwhere
RawVecInner: Sync,
impl Unpin for PhpDatePattern
impl UnsafeUnpin for PhpDatePattern
impl UnwindSafe for PhpDatePatternwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.