Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2005-01-08 12:07:58


On Sat, 08 Jan 2005 04:37:27 -0500, Stephen torri wrote

> I apologize for the confusion. I have two fact: time of creation and
> the epoch. The time of creation is given as the number of seconds
> that have elapsed since the epoch. The value I read from a file
> header is in seconds. So I want to do:
>
> Epoch + seconds = date & time.
>
> Something like:
>
> ptime epoch(date(1969,Dec,31), hours(16));
> seconds s_time (805168227);
>
> ptime creation_date = epoch + s_time;
>
> std::cout << "File created: " << creation_date.toString();

So all you should need to do is change the output line:
 
 //output the date plus the time
 std::cout << "File created: " << creation_date;

or

 //output just the date part.
 std::cout << "File created: " << creation_date.date();

HTH,

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