[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Slight oddity with os.date("")
- From: "Julien Cugnière" <julien.cugniere@...>
- Date: Wed, 21 Jun 2006 17:45:06 +0200
2006/6/21, Roberto Ierusalimschy <email@example.com>:
You are right about the problem. But your fix does not fix it :(
Non-empty format strings may also correctly result in the empty string
(e.g., "%p" or "%z" in some locales).
Oh, you're right, I hadn't thought of that! I suppose that with
strftime's API, there is no easy way around that.
Maybe you could cheat by appending a dummy char to the format, that
you then remove from the real output. For errors, strftime would still
return 0, but for "empty" strings it would return 1. That's an ugly
hack, though; probably not worth the trouble.