Skip to content

Commit

Permalink
std/time: add the Before method to Time
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Nov 28, 2024
1 parent dd79407 commit 401cf47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions std/time/time.jule
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ impl Time {
ret self.sec > u.sec || self.sec == u.sec && self.nsec > u.nsec
}

// Reports whether the time instant is before u.
fn Before(self, u: Time): bool {
ret self.sec < u.sec || self.sec == s.sec && self.nsec < u.nsec
}

fn appendTo(self, mut b: []byte)!: []byte {
b, ok := appendStrictRFC3339(self, b)
if !ok {
Expand Down

0 comments on commit 401cf47

Please sign in to comment.