mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
AK+LibC+LibCore+Kernel: Have fewer implementations of is_leap_year
This commit is contained in:
parent
394e4c04cd
commit
84ed257959
4 changed files with 19 additions and 20 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Time.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
@ -91,7 +92,7 @@ unsigned DateTime::day_of_year() const
|
|||
|
||||
bool DateTime::is_leap_year() const
|
||||
{
|
||||
return ((m_year % 400 == 0) || (m_year % 4 == 0 && m_year % 100 != 0));
|
||||
return ::is_leap_year(m_year);
|
||||
}
|
||||
|
||||
void DateTime::set_time(unsigned year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue