[Gambas-user] AM/PM - Noon to 1PM Problem

Benoit Minisini gambas at ...1...
Fri Oct 28 21:05:42 CEST 2005


On Thursday 20 October 2005 01:51, Rob Kudla wrote:
> On Wed October 19 2005 18:17, Benoit Minisini wrote:
> > > Well, strftime(), which is straight out of GNU libc, does
> > > this for 11:30, 12:30 and 13:30 (using %I:%M %p):
> > > 12:30 PM
> > > 01:30 PM
> >
> > I use strftime() - There is no other function I know.
>
> Interesting.  In that case, I don't understand why
>
> strftime("%I:%M %p", 0, 30, 12, 19, 10, 2005)
>
> returns 12:30 PM, but
>
> Format(Time(12, 30, 0), "h:nn AM/PM")
>
> which should be equivalent, returns 0:30 PM.  Aren't you
> evaluating the "h" placeholder as "%I"?
>
> Rob
>

OK, I understand the problem. What you need is:

Normal hour: 0 <= hour <= 23
Hour with AM/PM: 1 <= hour <= 12

The bug is that in the second case, gambas uses 0 <= hour <= 11

I will try to fix that.

Regards,

-- 
Benoit Minisini





More information about the User mailing list