With C++20, the std::chrono library received a major update, introducing (among other things) support for representing dates. An abstract (not necessarily valid) date can be represented using the std::chrono::year_month_day type, which supports arithmetic operations for years and months. An abstract date can be normalized to a system time, which also supports day arithmetic operations. System time truncated to second precision conceptually represents a date + time (std::chrono::sys_seconds), and truncated to day precision represents a date only (std::chrono::sys_days). Finally, std::chrono::weekday can be constructed from a system time to obtain the weekday. Compiler Explorer link: https://lnkd.in/etEVDcuf #cpp #cplusplus #coding #programming #dailybiteofcpp
Šimon Tóth’s Post
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
ImFusion GmbH•407 followers
1yWould be great to see more on conversions between clocks and time zones! I recently discovered that the system time zone database on Windows is pretty much hopelessly flawed and the time-zone support on clang is still quite limited!