mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +00:00
AK: Introduce UnixDateTime
This is a generic wrapper for a time instant relative to the unix epoch, and does not account for leap seconds. It should be used in place of Duration in most current cases.
This commit is contained in:
parent
0dfcaf1389
commit
c1323febc2
7 changed files with 154 additions and 0 deletions
|
@ -90,6 +90,12 @@ ErrorOr<void> encode(Encoder& encoder, Duration const& value)
|
|||
return encoder.encode(value.to_nanoseconds());
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder& encoder, UnixDateTime const& value)
|
||||
{
|
||||
return encoder.encode(value.nanoseconds_since_epoch());
|
||||
}
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder& encoder, URL const& value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue