Skip to content

convert string to timestamp shouldn't apply local timezone offset if there's no explicit timezone info in the string #2813

@waitingkuo

Description

@waitingkuo

Describe the bug

To Reproduce

use arrow::compute::kernels::cast_utils::string_to_timestamp_nanos;

fn main() {
    let t = string_to_timestamp_nanos("1970-01-01T00:00:00");
    println!("{:?}", t);
}

outputs

Ok(-28800000000000)

note that i'm in UTC+8

Expected behavior

should outputs

Ok(0)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrowChanges to the arrow cratebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions