Changes between Initial Version and Version 1 of Ticket #18471, comment 2


Ignore:
Timestamp:
Jun 22, 2023, 7:05:10 PM (17 months ago)
Author:
bipolar

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:
     1Using
    22
    3 On Haiku:
     3{{{
     4#include <ctime>
     5#include <cstdio>
     6#include <cstring>
    47
    5 `Testing "x": "Mar 17, 1999"`
     8int 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%";
    613
    7 On Linux and Win10:
     14        for (int i=0; i < strlen(specifiers); i++) {
     15                char fmt[3] = {};
     16                char buffer[80] = {};
    817
    9 `Testing "x": "03/17/99"`
     18                sprintf(fmt, "%%%c", specifiers[i]);
     19                strftime(buffer, 80, fmt, &time);
    1020
     21                printf("Testing '%c': '%s'\n", specifiers[i], buffer);
     22        }
     23}
     24
     25}}}
     26
     27I get proper results from strftime() (same values on Linux too, that match the .py version).
     28
     29So I guess it's a bug on our Python ports after all.
     30
     31This ticket should be closed as invalid. Sorry for the noise.