guiyanakuang commented on pull request #967:
URL: https://github.com/apache/orc/pull/967#issuecomment-985389979
@wgtmac , Unfortunately I think this is a new issue.
```c++
int main(int,char* argv[]){
struct tm timeStruct;
std::string name = "0001-01-01 00:00:00.000";
char *left=strptime(name.c_str(), "%Y-%m-%d %H:%M:%S", &timeStruct);
time_t _time = timegm(&timeStruct);
char *tail;
double d = strtod(left, &tail);
long na;
if (tail != left) {
na = static_cast<long>(d * 1000000000.0);
} else {
na = 0;
}
std::cout << _time << " " << na << std::endl;
}
```
On my mac machine the output is "-1 0"
Using the online C++ runtime environment claimed on Linux, the output is
"-62135596800 0"
Time format strings that appear to be older than 1970 get -1 on the mac.
> https://github.com/apache/orc/blob/main/c%2B%2B/test/TestWriter.cc#L621
> https://github.com/apache/orc/blob/main/c%2B%2B/test/TestWriter.cc#L741
It looks like the first test verifies that we can write time as a negative
number.
The second one holds our custom time zone. So I think this is a new issue.
Of course I verified the `converted_by_cpp.orc` uploaded by the user in
ORC-1055, and it is clear that it is not converted on the mac, so there should
be another issue that is not yet clear
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]