Exemplo n.º 1
0
/** Private implementation of GncDateTime. See the documentation for that class.
 */
static LDT
LDT_from_unix_local(const time64 time)
{
    try
    {
        PTime temp(unix_epoch.date(),
                   boost::posix_time::hours(time / 3600) +
                   boost::posix_time::seconds(time % 3600));
        auto tz = tzp.get(temp.date().year());
        return LDT(temp, tz);
    }
    catch(boost::gregorian::bad_year)
    {
        throw(std::invalid_argument("Time value is outside the supported year range."));
    }
}
Exemplo n.º 2
0
 GncDateImpl(): m_greg(unix_epoch.date()) {}
Exemplo n.º 3
0
 GncDateTimeImpl() : m_time(unix_epoch, tzp.get(unix_epoch.date().year())) {}