精华内容
下载资源
问答
  • <div><p>How use non gregorian calendar (Hijri, Persian) in dateaxis. I use moment for convert date.</p><p>该提问来源于开源项目:amcharts/amcharts4</p></div>
  • Globalize 0.x supported some non-gregorian calendars. But, Globalize 1.x hasn't migrated them yet (it supports the gregorian calendar only). | Calendar | Globalize 0.x | Globalize 1.x | ibm-js/...
  • <p>There is some common agreement that transition from Julian to Gregorian calendar system was after the last Juilan day <code>1582-10-04</code> followed by Gregorian <code>1582-10-15</code>....
  • Add support to the timestamp container to allow the ability to toggle/extend the Gregorian date to include the Persian date for both Persian and Pashto. <p>If we decide to continue using MomentJs, we ...
  • <div><p>When using a Gregorian calendar, several days were skipped somewhere in the 15th to 19th century when dropping the Julian calendar in favor of modern Gregorian, in order to bring the calendar ...
  • <div><p>As discussed in jquery/globalize#320 , this creates a generalized date class and allows for the use of non-gregorian calendars. This is more of a proof-of concept; only Gregorian dates are ...
  • <div><p>I am trying to convert a Hijri date back to gregorian with the internal function in the ar-SA calendar (other calendars seem to have the same toGregorian function). For example: <pre><code> ...
  • <div><p>https://docs.astropy.org/en/stable/time/index.html defines several time formats. It is unclear from the documentation whether the output is always Gregorian (or if it becomes julian prior to a...
  • use-gregorian的目标是提供构建日历或日期选择器所需的所有功能,同时让UI和UX由您自己决定。 发展 # install dependencies yarn # run storybook yarn storybook # make sure you didn't break nothing yarn test ...
  • // also includes gregorian_io.hpp class SubmissionInfo { public: template<typename archive> void serialize(Archive& ar) { ar(guid, submission_date); } std::string guid; boost::...
  • <div><p>Add calendar option, which follows the selected language and can be overridden manually, to handle non-Gregorian calendars relative times, e.g., <code>"13 months ago"</code> for ...
  • <div><p>New citation style for Pontifical Gregorian University</p><p>该提问来源于开源项目:citation-style-language/styles</p></div>
  • gregorian::date使用

    2015-12-31 19:29:34
    gregorian::date

                                                                    gregorian::date使用

        gregorian::date是一个以天为单位处理时间的类。它使用的是格里高利日历,即现行的公历日期。它能表示的范围是从1400-Jan-01到9999-Dec-31。

        它实现了多种格式的构造,多种格式的输出,方便的日期计算,以及和tm的互转。

    namespace gregorian
    {
    	class date : public date_time::date<date, gregorian_calendar, date_duration>
    	{
    	public:
    		date():
    		date_time::date<date, gregorian_calendar, date_duration>(
    			date_rep_type::from_special(not_a_date_time));
    		date(year_type y, month_type m, day_type d);
    		explicit date(const ymd_type& ymd);
    		explicit date(date_rep_type rhs);
    		explicit date(special_values sv);
    
    		date_int_type julian_day();
    		day_of_year_type day_of_year();
    		date_int_type modjulian_day();
    		int week_number();
    		date_int_type day_number();
    		date end_of_month();
    	};
    }
    
    namespace date_time 
    {
    	template<class T, class calendar, class duration_type_>
    	class date : private
    		less_than_comparable<T
    		, equality_comparable<T> >
    	{
    	public:
    		date(year_type y, month_type m, day_type d);
    		date(const ymd_type& ymd);
    
    		year_type        year();
    		month_type       month();
    		day_type         day();
    		day_of_week_type day_of_week();
    		ymd_type         year_month_day();
    		bool operator<(const date_type& rhs);
    		bool operator==(const date_type& rhs);
    		bool is_special();
    		bool is_not_a_date();
    		bool is_infinity();
    		bool is_pos_infinity();
    		bool is_neg_infinity();
    		special_values as_special();
    		duration_type operator-(const date_type& d);
    		date_type operator-(const duration_type& dd);
    		date_type operator-=(const duration_type& dd);
    		date_rep_type day_count();
    		date_type operator+(const duration_type& dd);
    		date_type operator+=(const duration_type& dd);
    	};
    }

    int DateTimer()
    {
    	using namespace boost;
    
    	//--------------------------------------------------------
    	// 构造
    	gregorian::date d0(2016, 1, 1);
    	gregorian::date d1 = d0 + gregorian::days(1);
    	gregorian::date d2(2016, 1, 1);
    	gregorian::date d3(2016, gregorian::Jan, 1);
    	gregorian::date d4(d0);
    	gregorian::date d5 = gregorian::from_string("2016-1-1");
    	gregorian::date d6 = gregorian::from_string("2016/1/1");
    	gregorian::date d7 = gregorian::from_undelimited_string("20160101");
    
    	//--------------------------------------------------------
    	// 输出
    	cout << "to_simple_string(d0) = " << to_simple_string(d0) << endl; // YYYY-mmm-DD
    	cout << "to_iso_string(d1) =  " << to_iso_string(d1) << endl; // YYYYMMDD
    	cout << "to_iso_extended_string(d2) = " 
    		 << to_iso_extended_string(d2) << endl; // YYYY-MM-DD
    	cout << "cout d3 = " << d3 << endl;
    	cout << "d4 julian day: " << d4.julian_day() << endl;
    
    	gregorian::date d8 = gregorian::day_clock::local_day();
    	cout << "cout d8 = " << d8 << endl;
    	gregorian::date d9 = gregorian::day_clock::universal_day();
    	cout << "cout d9 = " << d9 << endl;
    
    	//--------------------------------------------------------
    	// 与tm互转
    	tm tm_d = gregorian::to_tm(d0);
    	printf("tm_d.year = %d, tm_d.mon = %d, tm_d.day = %d\n", 
    		tm_d.tm_year, tm_d.tm_mon, tm_d.tm_mday);
    
    	gregorian::date d10 = gregorian::date_from_tm(tm_d);
    	cout << "cout d10 = " << d10 << endl;
    
    	return 0;
    }











    展开全文
  • <div><p>Currently, due to the use of <code>boost::gregorian::date, dates which come from the RDBMS with years outside the range 1400 to 10000 will fail to convert <p>Replacing <code>boost::gregorian::...
  • <div><p>Allow non-contiguous dates for Gregorian calendar, i.e. there can be dates before and after the missing days in 1582. <p>Before it was checked if min(dates) and max(dates) are below or above ...
  • The table contains a mixture of Julian and Gregorian date information, but should only contain Gregorian date information. <p>On such entry is: <code>1391 */{ 0 , 2 , 5 , 25904 },/* 29 30 30 29 29 30...
  • <p><strong>Overall change:</strong> <em>Pass locale correctly to Gregorian timestamps in Arabic & Urdu services.</em></p> <p><strong>Code changes:</strong></p> <h2>- <em>Imported respective moment...
  • boost/date_time/gregorian/gregorian.hpp date类 //获取今天的如期 date today = day_clock::local_day(); //日期初始化 date d1(2018, 9, 12); date d2 = from_string("2018-09-12"); date d3 = from...

    头文件
    boost/date_time/gregorian/gregorian.hpp

    date类

    //获取今天的如期
    date today = day_clock::local_day();
    
    //日期初始化
    date d1(2018, 9, 12);
    date d2 = from_string("2018-09-12");
    date d3 = from_string("2018/09/12");
    date d4 = from_undelimited_string("20180912");
    
    //month,week返回的是英文字符串,需要用as_number获取数字
    cout << d1.year() << "年" << d1.month().as_number() << "月" << d1.day() << "日" << endl;//2018年9月12日
    cout << to_simple_string(d2) << endl;//2018-Sep-12
    cout << to_iso_string(d3) << endl;//20180912
    cout << to_iso_extended_string(d4) << endl;//2018-09-12
    
    cout << today.year() << endl;//2018
    cout << today.month() << endl;//Sep
    cout << today.day() << endl;//12
    cout << today.week_number() << endl;//37
    cout << today.day_of_week() << endl;//Wed
    cout << today.day_of_year() << endl;//255
    cout << today.end_of_month() << endl;//2018-Sep-30

    日期计算

    days ds1(5);
    days ds2(-2);
    date_duration dd = ds1 + ds2;
    cout << dd << endl;//3
    cout << dd.days() << endl;//3
    
    weeks ws(1);
    cout << ws.days() << endl;//7
    cout << dd + ws << endl;//10
    
    months ms(1);
    cout << d1 + ms << endl;//2018-Oct-12
    
    years ys(1);
    cout << d1 + ys << endl;//2019-Sep-12
    展开全文
  • <div><p>This is the German version of the Pontifical Gregorian University style. Shortly I'll add other languages (French,Spanish,English)</p><p>该提问来源于开源项目:citation-style-language...
  • This is the related Gregorian year, e.g., as used in some Chinese calendar formats when the Gregorial year is put next to the year in a 60-year cycle. <p>The patch makes an editorial change to make ...
  • Flutter波斯语(Jalaali)和Gregorian线性日期选择器 该软件包提供了用于抖动的波斯或格里高利线性DatePicker。 将此包用作库 1.依赖它 将此添加到包的pubspec.yaml文件中: dependencies: flutter_linear_...
  • The current Western calendar system, primarily follows Gregorian calendar, and is so called the Gregorian Reformation, was adopted by Britain and the possessions on September 3, 1752. For lots of ...
  • <p>I have a problem when inserting date before the start of the gregorian calendar (10-15-1582) <p>If i insert a date in OrientDb before 10-15-1582, the date returned on select does not match to the ...
  • <ul><li>Anyone using NServiceBus version 4.3 on system with non-Gregorian calendar</li></ul> <h2>Symptoms <ul><li>NServiceBus license not parsed causing <code>System.FormatException</code> and ...
  • <p>I noticed a problem the ... Or could the plotting routine default to a leftmost date of year 1 for any cftime data with gregorian calendar?</p><p>该提问来源于开源项目:pydata/xarray</p></div>
  • s culture is set to Arabic the date shown on a DatePicker is in the Hijri calendar rather than the Gregorian calendar despite Gregorian dates being shown when the DatePicker is actually opened....
  • Gregorian calendar based on four different time categories: - <strong>DAILY:</strong> The start time of each interval is computed as the start of the day in which the first data point occurs, based ...
  • <div><p>Although standard and Gregorian calendars are equivalent, when plotting time series, we need the two strings to compare. To facilitate this, we should add two new functions cal2std and cal2...
  • <div><p>… issue <p>Fixes #4163 ...<p>Date is parsed using invariant culture to fix non-Gregorian calendar dates.</p><p>该提问来源于开源项目:dnnsoftware/Dnn.Platform</p></div>
  • <div><p>Snapshot versioning should use the Gregorian calendar for consistency across systems. Apply the fix reported by Anders Forsell to make that explicit, and include a somewhat overengineered test...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,173
精华内容 469
关键字:

gregorian