38 Commits

Author SHA1 Message Date
Howard Hinnant
ea2d0d3357 constexpr more stuff and clean up whitespace 2016-05-30 22:09:21 -04:00
Howard Hinnant
76bef1fe01 Support wide streams 2016-05-29 00:15:33 -04:00
Howard Hinnant
008178eee1 Make construction from local_days explicit 2016-05-21 12:46:11 -04:00
Howard Hinnant
76c906d779 Get off of day_point 2016-05-21 10:24:25 -04:00
Howard Hinnant
a8d8776ec7 MSC doesn't do inheriting constructors yet 2016-05-14 11:43:26 -04:00
Howard Hinnant
1e5d2fa8dd Create local and system time types for timezone functions.
* Add sys_time.
* Add sys_days.
* Add sys_seconds.
* Add local_time.
* Add local_days.
* Add local_seconds.
* Rename day_point to sys_days.
* Rename Zone to time_zone.
2016-05-03 23:19:09 -04:00
Howard Hinnant
95271f8337 Minor fixes 2016-04-21 16:21:01 -04:00
Howard Hinnant
e8f95dddb7 Add format and parse functionality. 2016-04-03 18:57:02 -04:00
gm
a093521890 Remove floor, ceil, round and abs when VS Update 2 is present as it's chrono has this polishing. 2016-03-30 21:47:40 -04:00
Howard Hinnant
f73c4aa486 Deal with warnings. 2016-03-11 23:02:29 -05:00
galik
177032852d prevent GCC warning/error when using -pedantic or -pedantic-errors flags 2016-02-04 00:56:56 +00:00
Howard Hinnant
e988efad90 Small negative floating point values should trunc and round to -0. instead of 0. 2016-01-01 15:27:17 -05:00
Howard Hinnant
4a4a864964 Minor polishing 2015-11-28 17:41:17 -05:00
ivanp2015
ca74113ae8 date.h fixed for VS2013 2015-11-29 00:19:24 +02:00
Howard Hinnant
1d23665bd4 Change __int128 protection. 2015-11-28 12:45:27 -05:00
Howard Hinnant
e08458e279 Update rounding utilities. 2015-11-22 21:57:49 -05:00
Howard Hinnant
c5f307fdb8 Renamed date_literals to date::literals and corrected placement. 2015-11-09 20:28:04 -05:00
Howard Hinnant
819d2c3575 Minor cleanup and crank up warnings. 2015-10-27 12:14:30 -04:00
Howard Hinnant
333894fc9d Merge branch 'gm_issue_19' of git://github.com/gmcode/date into gmcode-gm_issue_19 2015-10-27 11:53:29 -04:00
Howard Hinnant
342d15ce56 Give last_spec an explicit default ctor 2015-10-27 11:52:31 -04:00
gm
2467d56f11 Address issue 19: define NOMINMAX and WIN32_LEAN_AND_MEAN. In addition, fix some warnings so MSVC will compile at /W4 with no warnings.
No functional change intended.
2015-10-22 22:36:37 +13:00
Howard Hinnant
c8ee261043 Added a few convenience field getters:
* year_month_weekday::weekday()
* year_month_weekday::index()
* year_month_weekday_last::weekday()
2015-09-19 13:46:09 -04:00
Howard Hinnant
6af1976e36 Move all literals into namespace date_literals
This includes both the literal operators, and the constexpr literals such as sun and jan.
2015-09-06 17:58:29 -04:00
Howard Hinnant
a0d2343eab Try disabling construction of weekday from int.
Also fix bug in round for negatives.
2015-09-02 20:48:44 -04:00
Howard Hinnant
9b79ad2ce2 Add tests for time_of_day and make_time 2015-08-15 14:21:43 -04:00
Howard Hinnant
4b8ca1c24d Change year_month_day_last to store a {year, month_day_last}
* from storing a {year, month}.
    * Change constructor from {year, month} to {year, month_day_last}.
    * Add getter from year_month_day_last().
    * Fix up operator/() as required.
    * This is an API change, but not a functionality change.
    * Rationale: consistency.
2015-08-09 18:37:46 -04:00
Howard Hinnant
e701a42ced Change month_weekday_last to store a {month, weekday_last}
* from storing a {month, weekday}.
* Change constructor from {month, weekday} to {month, week_last}.
* Change getter from weekday() to weekday_last().
* Fix up operator/() as required.
* This is an API change, but not a functionality change.
* Rationale: consistency.
2015-08-09 16:30:42 -04:00
Howard Hinnant
999dfc4b37 Change to MIT copyright
* Added unicode copyright to CLDR-derived mapping.
2015-08-08 17:03:43 -04:00
Howard Hinnant
2d115a8022 Add to_duration() to time_of_day:
* This is a synonym for static_cast<precision>(*this).
* This variation can be easier to spell when the precision
  is not conveniently available.
2015-08-08 13:38:12 -04:00
gm
c21e392c81 Initial Win32 support.
This library now compiles on Windows but requires VS2015 for Windows.
VS2013 may work but this has not been tested yet.
Requires NOMINMAX to be defined to avoid clashes with the Windows.h
headers and the C++ stl and this libraries Date max functions.
Also known to work equivalently with recent g++ and mingw combinations
but -std=C++14 flag should be set.
C++14 restrictions may be relaxed later. Patches welcome!
g++ 5.1 was tested. It may work with other version but that hasn't been tried.
Mac OS and Linux systems are known to compile with -std=c++11
current_timezone and locate_zone will return iana names not windows
time zone names. This is expected and as designed.
2015-08-06 23:16:03 -04:00
Howard Hinnant
16775dccb9 Remove streaming for time_points with resolution greater...
than a day.

* cout << floor<years>(system_clock::now()) is very confusing.
* The aforementioned streaming operation is now a compile time error.
2015-08-03 22:13:20 -04:00
Howard Hinnant
94237ceaa7 Take into account that year::ok() may now return false. 2015-08-02 12:30:49 -04:00
Howard Hinnant
c99a40b846 Add year_month += and -= operators. 2015-08-01 19:16:33 -04:00
Howard Hinnant
2e715844bb Restrict the range of year:
to within the range of chrono::minutes.
* This prevents overflow when adding minutes to day_point
  when minutes is stored in 32 bits.
* Also added static checks on the range of hours and seconds.
  If these static checks fire, the range of year should be
  further reduced.
* This does not impact gcc at all.  It impacts clang only
  when targeting 32 bit architectures.  And it fixes
  overflow on Visual Studio.
* Thanks much to https://github.com/gmcode for the herculean
  effort in tracking this down.
2015-08-01 16:49:51 -04:00
Howard Hinnant
07361f9d86 Reduce technology down to what VS can handle. 2015-07-28 11:00:53 -04:00
Howard Hinnant
0c44d8c70d Specialize streaming operator for day_point. 2015-07-20 14:58:05 -04:00
Howard Hinnant
a431164fcd Add missing 'backward' file and correct output of negative values for time_of_day_storage. 2015-07-18 17:40:18 -04:00
Howard Hinnant
796448e4ad Initial commit 2015-07-17 22:30:53 -04:00