You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "gowerc (via GitHub)" <gi...@apache.org> on 2025/03/11 18:46:00 UTC
Re: [I] `compute::LocalTimestamp()` Performs incorrect conversion [arrow]
gowerc commented on issue #45751:
URL: https://github.com/apache/arrow/issues/45751#issuecomment-2715388481
Just to add experimenting with a different timezone library ([link](https://github.com/HowardHinnant/date)) I also get the expected 2222982812 value:
```cpp
#include <iostream>
#include <chrono>
#include <date/date.h>
#include <date/tz.h>
int main() {
date::sys_seconds utc_time{std::chrono::seconds(2222997212)};
date::zoned_time ny_time{"America/New_York", utc_time};
std::cout << "Epoch seconds: " << ny_time.get_sys_time().time_since_epoch().count() << std::endl;
std::cout << "UTC time: " << date::format("%F %T %Z", utc_time) << '\n';
std::cout << "NY time: " << date::format("%F %T %Z", ny_time) << '\n';
date::local_seconds naive_local = ny_time.get_local_time();
std::cout << "NY time naive:: " << naive_local.time_since_epoch().count() << "\n";
}
```
Output:
```
Epoch seconds: 2222997212
UTC time: 2040-06-11 03:13:32 UTC
NY time: 2040-06-10 23:13:32 EDT
NY time naive:: 2222982812
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org