#include "ofApp.h" #include "Poco\Timespan.h" #include "Poco\DateTime.h" using namespace Poco; //-------------------------------------------------------------- void ofApp::setup(){ Timespan _fewDays(3, 0, 0, 0, 0); // 3일 DateTime _today(2016,1,1); DateTime _before = _today - _fewDays; DateTime _ago = _today + _fewDays; cout << "today is : " << _today.year() << "/" << _today.month() << "/" << _today.day() << endl; cout << "- 3 days : " << _before.year() << "/" << _before.month() << "/" << _before.day() << endl; cout << "+ 3 days : " << _ago.year() << "/" << _ago.month() << "/" << _ago.day() << endl; // 오늘로 날짜 리셋 _today = DateTime(ofGetYear(), ofGetMonth(), ofGetDay()); DateTime _olyrimpicDay(2018, 2, 9); Timespan dday = _olyrimpicDay - _today + 1; // 오늘 부터 1일 cout << dday.days() << endl; // 평창 올림픽 까지 남은 날. }
C# 만큼 편리한 계산이 가능함.
'C++(oF)' 카테고리의 다른 글
libVLC 를 이용한 캡처장치 수신 (0) | 2016.07.31 |
---|---|
보다 높은 퍼포먼스를 위한 LIBVLC 사용 (0) | 2016.07.29 |
Poco 를 이용한 날짜 계산 (0) | 2016.07.10 |
[of] LIB VLC 사용하기 (0) | 2016.07.09 |
Blur쉐이더 , Desktop 용 (0) | 2016.06.18 |
Desktop 과 IOS(openGLES2.0) 의 쉐이더 텍스처 기본 시작 코드 (0) | 2016.06.18 |