Skip to content

Commit 8758659

Browse files
simonbyrneKristofferC
authored andcommitted
Fix calculation of displayed time, show UTC offset (JuliaLang#22136)
* Fix calculation of displayed time, show UTC offset Fixes JuliaLang#22103. * add space to argument
1 parent f1878c1 commit 8758659

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

base/libgit2/signature.jl

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ function Base.convert(::Type{GitSignature}, sig::Signature)
3535
return GitSignature(sig_ptr_ptr[])
3636
end
3737

38-
Base.show(io::IO, sig::Signature) = print(io, "Name: $(sig.name), Email: $(sig.email), Time: $(Dates.unix2datetime(sig.time + sig.time_offset))")
38+
function Base.show(io::IO, sig::Signature)
39+
print(io, "Name: ", sig.name, ", ")
40+
print(io, "Email: ", sig.email, ", ")
41+
print(io, "Time: ", Dates.unix2datetime(sig.time + 60*sig.time_offset))
42+
@printf(io, "%+03i:%02i", divrem(sig.time_offset, 60)...)
43+
end
3944

4045
"""Return signature object. Free it after use."""
4146
function default_signature(repo::GitRepo)

0 commit comments

Comments
 (0)