1
0
mirror of https://github.com/bspeice/dtparse synced 2025-08-27 17:55:06 -04:00

Add tokenization from Dateutil

This commit is contained in:
Bradlee Speice
2018-05-15 00:50:14 -04:00
parent 9ab5a3d5e3
commit af0908c3cc
3 changed files with 265 additions and 8 deletions

View File

@ -2,15 +2,15 @@ extern crate chrono;
extern crate dtparse;
use chrono::DateTime;
use chrono::Utc;
use chrono::NaiveDate;
use chrono::NaiveTime;
use chrono::NaiveDateTime;
use chrono::NaiveTime;
use chrono::Utc;
use dtparse::parse;
macro_rules! ymd_test {
($date: expr, $year: expr, $month: expr, $day: expr) => {
($date:expr, $year:expr, $month:expr, $day:expr) => {
let nd = NaiveDate::from_ymd($year, $month, $day);
let nt = NaiveTime::from_hms(0, 0, 0);
let dt = NaiveDateTime::new(nd, nt);
@ -26,4 +26,4 @@ macro_rules! ymd_test {
#[test]
fn test_basic() {
ymd_test!("2014 January 19", 2014, 1, 19);
}
}