Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2005-09-18 20:20:46


On Mon, 19 Sep 2005 01:50:37 +0200, Tobias Grimm wrote
> Hi,
>
> Jeff Garland wrote:
>
> >You are exactly right. For the base time information you should be able to do
> >the following (I didn't test this)...
> >
> > time_facet* timefacet = new time_facet("%a, %d %b %Y %H:%M:%S");
> >
> >
>
> Mmm... I even can't get this to compile.

Sorry I wasn't watching the boost versions -- this facet code is a 1.33
feature. It's pretty much impossible with 1.32 facet code...

> >Probably a better approach would be to check out the spirit grammer
> >for rfc822 written by Peter Simons. Look for 'rfcdate' at
> >
> >
>
> Thanks a millon! This looks interesting.

You'll still have to do some work to integrate them as rfcdate produces a tm
and not a date-time type (although there is a simple function to convert a tm
to a ptime). Oh and the posix_time_zone and local_time classes are also 1.33
features so if you want to use them you'll need to upgrade. But in lots of
scenarios you can just drop the tz data and construct a UTC time...all depends
on what you want to do after you get the time. Anyway, if you make a nice
variant of the rfc822 parser and want to contribute it back I'll be happy to
look at putting it in as at least an example ;-) Good luck.

Jeff


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net