[haiku-development] Re: Extending the BTime class

  • From: Christophe Huriaux <c.huriaux@xxxxxxxxx>
  • To: haiku-development <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 12 Jul 2010 18:24:08 +0200

2010/7/13 Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>

> Hello,
>

Hi,


> I'm working on localizing the Time preflet (and designing a suitable
> API fr that, because it needs editable date and times). I've found that
> the preflet uses BTime and BDate to hold the values. However, ICU is
> unable to work with these class, and there is no way to get a posix
> time_t out of them.
>
>
AFAIK, BDateTime have SetTime_t() and Time_t() members (with an int32
parameter/return type). Assuming that all the time functions implementation
in Haiku share the same time_t meaning (i.e: number of seconds since epoch),
they should do the BDateTime <-> time_t conversion as well, no ?



> These classes are not part of the Be Book, so I guess they are new in
> Haiku. Is it ok to change them and add something either to convert to a
> posix time I can use in the locale kit, or even better, a method to
> render them as localized strings, so that everyone can use localized
> times easily ? This solution would be more problematic because it would
> need liblocale.so linked in the application, but it sounds more clean.
> What do you think about it ?
>
> --
> Adrien.
>
>
>
>
Regards,
Christophe Huriaux

Other related posts: