summaryrefslogtreecommitdiff
path: root/AK/Time.cpp
AgeCommit message (Collapse)Author
2021-09-01AK: Remove dead store from Time:operator+Brian Gianforcaro
This is written, but never read again, and is thus useless.
2021-08-22AK: Use POSIX specified types for Time::to_timespec and to_timevalRichard Wurth
The previous implementation assumed 64-bit time_t and 32-bit long, which is not true on some 32-bit systems
2021-08-15AK: Add Time::now_<clock_id> functions for obtaining the current timeBrian Gianforcaro
In the quest of removing as timespec / timeval usage in the Userland as possible, we need a way to conveniently retrieving the current clock time from the kernel and storing it in `AK::Time` format.
2021-05-19Time: Remove static from function local constexpr variableLenny Maiorani
Problem: - Function local `constexpr` variables do not need to be `static`. This consumes memory which is unnecessary and can prevent some optimizations. - C-style arrays are not as safe as AK::Arrays and require the user to specify the length of the array manually. Solution: - Remove `static` keyword. - Change from C-style array for AK::Array.
2021-04-29Everywhere: Use "the SerenityOS developers." in copyright headersLinus Groh
We had some inconsistencies before: - Sometimes "The", sometimes "the" - Sometimes trailing ".", sometimes no trailing "." I picked the most common one (lowecase "the", trailing ".") and applied it to all copyright headers. By using the exact same string everywhere we can ensure nothing gets missed during a global search (and replace), and that these inconsistencies are not spread any further (as copyright headers are commonly copied to new files).
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-13AK: Fix some overflows/underflows that weren't properly handledBen Wiederhake
Based on #5699. Closes #5699.
2021-03-12Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)Andreas Kling
Good-bye LogStream. Long live AK::Format!
2021-03-08AK: Take advantage of constexpr in Time and add time conversion methodsTom
By making the Time constructor constexpr we can optimize creating a Time instance from hardcoded values. Also add more functions to convert between Time and various time units.
2021-03-02AK: Make Time more usableBen Wiederhake
2021-03-02AK: Implement C++ 'Time' type for easier time-calculationsBen Wiederhake
This adds a bunch of code in the hope that other, wrong code can be deleted. Related to #5315.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2020-08-26AK+LibC+LibCore: Have fewer implementations of day_of_weekNico Weber
The implementation in LibC did a timestamp->day-of-week conversion which looks like a valuable thing to have. But we only need it in time_to_tm, where we already computed year/month/day -- so let's consolidate on the day_of_week function in DateTime (which is getting extracted to AK).
2020-08-26AK+LibC+LibCore: Have fewer implementations of days_in_monthNico Weber
2020-08-26AK+LibCore+Kernel: Have fewer implementations of day_of_yearNico Weber
The JS tests pointed out that the implementation in DateTime had an off-by-one in the month when doing the leap year check, so this change fixes that bug.