Changes between Initial Version and Version 1 of Ticket #18471, comment 2
- Timestamp:
- Jun 22, 2023, 7:05:10 PM (17 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18471, comment 2
initial v1 1 Re-checking the output of the script above, noticed that "%x" also shows differences: 1 Using 2 2 3 On Haiku: 3 {{{ 4 #include <ctime> 5 #include <cstdio> 6 #include <cstring> 4 7 5 `Testing "x": "Mar 17, 1999"` 8 int main(void) 9 { 10 // Python's test data: {1999, 3, 17, 22, 44, 55, 2, 76, 0} 11 struct tm time = {55, 44, 22, 17, 2, 99, 3, 75, 0}; 12 const char specifiers[] = "aAbBcCdDehHIjmMnprRStTUwWxXyY%"; 6 13 7 On Linux and Win10: 14 for (int i=0; i < strlen(specifiers); i++) { 15 char fmt[3] = {}; 16 char buffer[80] = {}; 8 17 9 `Testing "x": "03/17/99"` 18 sprintf(fmt, "%%%c", specifiers[i]); 19 strftime(buffer, 80, fmt, &time); 10 20 21 printf("Testing '%c': '%s'\n", specifiers[i], buffer); 22 } 23 } 24 25 }}} 26 27 I get proper results from strftime() (same values on Linux too, that match the .py version). 28 29 So I guess it's a bug on our Python ports after all. 30 31 This ticket should be closed as invalid. Sorry for the noise.