datetime.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include<iostream>
  2. #include <string>
  3. //êåñëè þçàþ ñëîâàðè - íàäî äîêàçàòü
  4. using namespace std;
  5. const char MONTHS[12][80] = { {"January"},{"Febuary"},{"March"},{"April"},{"May"},{"June"},{"July"},{"August"},{"September"},{"October"},{"November"},{"December"} };
  6. const char DAYS[7][80] = { {"Monday"},{"Tuesday"},{"Wednesday"},{"Thursday"},{"Friday"},{"Saturday"},{"Sunday"} };
  7. #pragma once
  8. class date
  9. {
  10. private:
  11. unsigned long long julian;
  12. void date_split(char word[], char splitter);
  13. void date_words(char word[]);
  14. void create_from_numbers(int, int, int);
  15. void date_from_julian();
  16. public:
  17. int day, month, year;
  18. void week_day();
  19. char actual[];
  20. date();
  21. date(char word[]);
  22. date(int year, int month, int date);
  23. const date& get_dates_year_easter();
  24. const unsigned long long& operator - (const date& d);
  25. const bool& operator<(const date& d);
  26. const bool& operator>(const date& d);
  27. const bool& operator>=(const date& d);
  28. const bool& operator<=(const date& d);
  29. const bool& operator==(const date& d);
  30. friend ostream& operator <<(ostream& os, date& d);
  31. };
  32. class date_exception {
  33. };