Skip to content

Commit

Permalink
Minor: improve documentation on timezone representations (#7000)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Jan 22, 2025
1 parent 595a835 commit a378728
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions arrow-schema/src/datatype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,17 @@ pub enum DataType {
/// DataType::Timestamp(TimeUnit::Second, Some("literal".into()));
/// DataType::Timestamp(TimeUnit::Second, Some("string".to_string().into()));
/// ```
/// For UTC time
///
/// # Timezone representation
/// ----------------------------
/// For UTC time, it is possible to use either the timezone representation, such as "UTC", or the absolute time zone offset "+00:00".
/// However, it is better to use the offset representation, as it is more explicit and less ambiguous.
/// This also ensures that other arrow-rs functionalities can interpret the UTC timestamps correctly
/// For example, the `with_timezone_utc` method that is applied on timestamp arrays to add the UTC timezone.
/// It is possible to use either the timezone string representation, such as "UTC", or the absolute time zone offset "+00:00".
/// For timezones with fixed offsets, such as "UTC" or "JST", the offset representation is recommended, as it is more explicit and less ambiguous.
///
/// Most arrow-rs functionalities use the absolute offset representation,
/// such as [`PrimitiveArray::with_timezone_utc`] that applies a
/// UTC timezone to timestamp arrays.
///
/// [`PrimitiveArray::with_timezone_utc`]: https://docs.rs/arrow/latest/arrow/array/struct.PrimitiveArray.html#method.with_timezone_utc
///
/// Timezone string parsing
/// -----------------------
Expand Down

0 comments on commit a378728

Please sign in to comment.