Exemple #1
0
	std::string Islamic::to_string() const & {
		std::ostringstream oss;
		std::string weekday;
		year_t year = year_;
		weekday = ((islamic_day_name(  ((day_of_week(to_jd()) + 1) % 7 )  ) )  );

		oss << weekday << ", " << islamic_month_name(month_) << ' ' << day_ << ' ';
		oss << year << ", " << hms_to_string(hour_, minute_, second_);
		return oss.str();
	}
Exemple #2
0
	std::string Julian::to_string() const & {
		std::ostringstream oss;
		std::string era(" AD, ");
		std::string weekday;
		year_t year = year_;
		if (year < 0) {
			year = abs(year) + 1;
			era = " BC, ";
			weekday = ((julian_day_name((day_of_week(julian_to_jd(year, month_, day_)) % 7))));
		}
		else {
			weekday = ((julian_day_name((day_of_week(to_jd())))));
		}
		oss << weekday << ", " << julian_month_name(month_) << ' ' << day_ << ' ';
		oss << year << era << hms_to_string(hour_, minute_, second_);
		return oss.str();
	}
		// Implicit cast to Jd class.
		operator Jd() const { return Jd(to_jd()); }