ports/devel/date/files/test-minimal.cpp
Robert Clausecker 5ef69a723b devel/hhdate: move to devel/date
Now that the old devel/date has been removed, use the old port name
for the version we decided to keep.

PR:		272778
Reported by:	Alexander Chernyavsky <nickp102@gmail.com>
Approved by:	sunpoet
2023-08-06 14:42:47 +02:00

21 lines
585 B
C++

// Small example taken from https://howardhinnant.github.io/date/date.html.
// Only for testing installed header shortly.
#include <iostream>
#include "../include/date/date.h"
int main()
{
using namespace std;
using namespace date;
for (auto m = 1; m <= 12; ++m)
{
auto meet = year_month_day{m/fri[1]/2015};
cout << meet << '\n';
meet = meet.year()/meet.month()/(meet.day()+weeks{2});
cout << meet << '\n';
meet = meet.year()/meet.month()/(meet.day()+weeks{2});
if (meet.ok())
cout << meet << '\n';
}
}