Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#833 closed Bugs (None)

Boost::posixtime (1.33.1) from_time_t

Reported by: gamial Owned by: nobody
Milestone: Component: date_time
Version: None Severity:
Keywords: Cc:

Description

Code:

time_t value2 = 0x80000001;//FFFFFFF;
CTime ct_time((UINT)value2);//ATL. 
ptime m_time=from_time_t((UINT)value2);

cout<<"Boost time: "<<m_time<<endl;
cout<<"Real time: "<<ct_time.Format("%Y %m %d %H:%M:%S")<<endl;

COUT:
Boost time: 1901-Dec-13 20:45:53
Real time: 2038 01 19 06:14:09

Change History (2)

comment:1 by cepstein, 16 years ago

Status: assignedclosed
Logged In: YES 
user_id=36183
Originator: NO

Given that the bug report mentions CTime, this must be on Windows.

You've exceeded the maximum allowable value for time_t on this platform.

See, for example, http://www.2038bug.com/

comment:2 by gamial, 16 years ago

Logged In: YES 
user_id=1720265
Originator: YES

Yes, ofcouse. 2038 y - is limit. BUT! It mast be "not valid date". Becouse time_t is time FROM 1970. NOT before.
Note: See TracTickets for help on using tickets.