3

If locale is set to zh_CN.ut8, and using strftime("%b %Y", time()); It shows 9月2010 instead of 9月2010年。 This is not correct in chinese date, the year character (年)should be display at the end of the numeric year. Is there a way to solve this problem? I know I can append the character manually, example:

strftime("%b %Y", time())."年"

but would like to know if there's a better way to solve it.

phuang07
  • 981
  • 1
  • 9
  • 18

2 Answers2

1

No better way. I use this

strftime('%Y年%m月%e日');
Peter
  • 11
  • 1
0

There is no better way. Prepare your dates with as few characters in them. Think of dates as numbers only. While you are able to output AM/PM, it's better to determine that on your own, for example. The reason for this is that it makes for cleaner and more intuitive code on your side.

Geekster
  • 336
  • 1
  • 10