Why does Perl's POSIX::strftime %F specifier not work on Windows?

后端 未结 1 1514
一生所求
一生所求 2021-02-20 10:56

I\'m the author of the Mac::PropertyList module which parses the Apple property list format. I\'ve designed this to work across platforms, but I\'m having trouble with POSIX\'s

相关标签:
1条回答
  • 2021-02-20 11:32

    As I was writing this question and researching everything, I found my own answer. I don't want all that work to go to waste though.

    The %F format I used is not portable, and the POSIX module says so in its strftime entry:

    If you want your code to be portable, your format ("fmt")
    argument should use only the conversion specifiers defined by
    the ANSI C standard (C89, to play safe).  These are
    "aAbBcdHIjmMpSUwWxXyYZ%".
    

    %F is really %Y-%m-%d, so I should use that.

    My particular problem is that I know that the POSIX module tells you which format specifiers you can use to be portable, but I still have to look at the strftime man page to see what they do. In looking at the man page, I forget to check which ones are portable.

    0 讨论(0)
提交回复
热议问题