I am using boost gregorian library for date calculation in c++ boost gregorian returns week number in ISO format but I want week number in US format.
how I can get week number in US format.
please see link https://planetcalc.com/1252/
e.g.
#include <boost/date_time/gregorian/gregorian.hpp>
int main(int argc, char* argv[])
{
boost::gregorian::date myday1 = boost::gregorian::from_simple_string("2005-1-1");
int weekNum1 = myday1.week_number(); //return ISO which is 53 //week 1 as US method
boost::gregorian::date myday2 = boost::gregorian::from_simple_string("2005-1-2");
int weekNum2 = myday2.week_number(); //return ISO which is 53 //week 2 as US method
return 0;
}
Using visual studio 2019 community on windows 10
I find no direct way in C++ or any library which support US method for week number, So I have to use CLR dll and call it from native C++.
C++/CLI File