diff --git a/README.md b/README.md index 76013b8..dfed8dc 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,8 @@ features](https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-s and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the `Value` type from the [`serde_json` crate](https://crates.io/crates/serde_json). * `time` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) - and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the - `time::OffsetDateTime` type from the [`time` crate](https://crates.io/crates/time). + and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for various + types from the [`time` crate](https://crates.io/crates/time). * `url` implements [`FromSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.FromSql.html) and [`ToSql`](https://docs.rs/rusqlite/~0/rusqlite/types/trait.ToSql.html) for the `Url` type from the [`url` crate](https://crates.io/crates/url). diff --git a/src/types/time.rs b/src/types/time.rs index 5be717a..265d6c6 100644 --- a/src/types/time.rs +++ b/src/types/time.rs @@ -1,4 +1,15 @@ +//! Convert formats 1-10 in [Time Values](https://sqlite.org/lang_datefunc.html#time_values) to time types. //! [`ToSql`] and [`FromSql`] implementation for [`time::OffsetDateTime`]. +//! [`ToSql`] and [`FromSql`] implementation for [`time::PrimitiveDateTime`]. +//! [`ToSql`] and [`FromSql`] implementation for [`time::Date`]. +//! [`ToSql`] and [`FromSql`] implementation for [`time::Time`]. +//! Time Strings in: +//! - Format 2: "YYYY-MM-DD HH:MM" +//! - Format 5: "YYYY-MM-DDTHH:MM" +//! - Format 8: "HH:MM" +//! without an explicit second value will assume 0 seconds. +//! Time String that contain an optional timezone without an explicit date are unsupported. +//! All other assumptions described in [Time Values](https://sqlite.org/lang_datefunc.html#time_values) section are unsupported. use crate::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, ValueRef}; use crate::{Error, Result};