File: convert_to_pacific.rs

package info (click to toggle)
rust-dateparser 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 244 kB
  • sloc: makefile: 2
file content (9 lines) | stat: -rw-r--r-- 267 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
use chrono_tz::US::Pacific;
use dateparser::DateTimeUtc;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let parsed = "Wed, 02 Jun 2021 06:31:39 GMT".parse::<DateTimeUtc>()?.0;
    println!("{:#?}", parsed.with_timezone(&Pacific));
    Ok(())
}