Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: improve documentation on timezone representations #7000

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading