pub fn normalize(&'_ self) -> Result<std::borrow::Cow<'_, TimestampRef>, TimestampParseError> {
        let s = self.as_str();
        if s.ends_with('Z') {
            Ok(self.into())
        } else {
            #[cfg(feature = "chrono")]
            {
                let utc: chrono::DateTime<chrono::Utc> = self.to_utc();
                return Ok(std::borrow::Cow::Owned(utc.into()));
            }
            #[allow(unreachable_code)]
            Err(TimestampParseError::Other("normalization for non `Z` timestamps is not enabled without the `chrono` feature enabled for `twitch_api2`"))
        }
    }
/// Normalize the timestamp into UTC time.
///
/// # Examples
///
/// ```rust
/// use twitch_api2::types::Timestamp;
///
/// let time = Timestamp::new("2021-07-01T13:37:00Z").unwrap();
/// assert_eq!(time.normalize()?.as_ref(), &time);
/// let time2 = Timestamp::new("2021-07-01T13:37:00-01:00").unwrap();
/// assert_ne!(time2.normalize()?.as_ref(), &time2);
/// # Ok::<(), std::boxed::Box<dyn std::error::Error + 'static>>(())
/// ```
Normalize the timestamp into UTC time.
Normalize the timestamp into UTC time .
pub fn normalize(&'_ self) -> Result<std::borrow::Cow<'_, TimestampRef>, TimestampParseError> {
        let s = self.as_str();
        if s.ends_with('Z') {
            Ok(self.into())
        } else {
            #[cfg(feature = "chrono")]
            {
                let utc: chrono::DateTime<chrono::Utc> = self.to_utc();
                return Ok(std::borrow::Cow::Owned(utc.into()));
            }
            #[allow(unreachable_code)]
            Err(TimestampParseError::Other("normalization for non `Z` timestamps is not enabled without the `chrono` feature enabled for `twitch_api2`"))
        }
    }
pub fn normalize ( & ' _ self ) -> Result < std :: borrow :: Cow < ' _ , TimestampRef > , TimestampParseError > { let s = self . as_str ( ) ; if s . ends_with ( 'Z' ) { Ok ( self . into ( ) ) } else { # [ cfg ( feature " " ) ] { let utc : chrono :: DateTime < chrono :: Utc > = self . to_utc ( ) ; return Ok ( std :: borrow :: Cow :: Owned ( utc . into ( ) ) ) ; } # [ allow ( unreachable_code ) ] Err ( TimestampParseError :: Other ( " " ) ) } }
Normalize the timestamp into UTC time.
Normalize the timestamp into UTC time .
&'_ self
&'_ self
examples
```rust
use twitch_api2::types::Timestamp.


` ` ` rust use twitch_api2 :: types :: Timestamp .
ok::<(), std::boxed::box<dyn std::error::error + 'static>>(())
None