2
我用下面的代碼獲取當前日期時間(山地時間)轉換加速的ptime要EST UTC-5:00
const boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
//In mountain time I get now = 2013-Apr-08 20:44:22
現在,我使用下面的方法轉換
ptime FeedConnector::MountaintToEasternConversion(ptime coloTime)
{
return boost::date_time::local_adjustor <ptime, -5, us_dst>::utc_to_local(coloTime);
}
//這個函數是想給我在紐約時間(東部標準時間),我得到
2013-Apr-08 16:44:22
Thsi時間是錯誤的任何建議我哪裏出錯了?
我想知道答案。 – user805547 2013-04-09 02:45:44