timestamp_t as string or similar

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Wed Apr 17 00:43:36 PDT 2013


Perfect - thanks.

While looking at weekday & monthname functions as defined in
main.c.....should declarations in dive.h : 636 / 637 not be extern ?


A


On Tue, Apr 16, 2013 at 10:33 PM, Linus Torvalds <
torvalds at linux-foundation.org> wrote:

> On Tue, Apr 16, 2013 at 2:18 PM, Amit Chaudhuri
> <amit.k.chaudhuri at gmail.com> wrote:
> >
> > Ultimately, I'm looking to convert to QString so char * would do.  I've
> not
> > seen any references to asctime in the code, but my current guess is I
> need
> > to use time.c to create a tm and then use asctime.  Seems a bit around
> the
> > houses - am I missing something?
>
> Don't use asctime. We've had trouble with it, it doesn't do a good job
> of localization etc.
>
> Currently we just do "utc_mkdate()" on it, and print things out in
> whatever needed format. So far we haven't had *that* many cases, and
> the format for them has been sufficiently varied that there hasn't
> been much reason for a helper function (I don't think *any* of them
> actually want the asctime/ctime format). But if you want to make some
> helper functions for creating the most common formats, go wild. Just
> make sure you do *not* use asctime, and instead just do the trivial
> lookup by hand (ie use the "weekday()" and "monthname()" helpers to
> create the textual parts.
>
> Just grep for utc_mkdate() and you'll see examples.
>
>              Linus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130417/a2ccc777/attachment.html>


More information about the subsurface mailing list