We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59d75fc commit 13799e2Copy full SHA for 13799e2
git-actor/src/time.rs
@@ -23,6 +23,15 @@ impl Default for Time {
23
}
24
25
impl Time {
26
+ /// Create a new instance from seconds and offset.
27
+ pub fn new(seconds_since_unix_epoch: u32, offset_in_seconds: i32) -> Self {
28
+ Time {
29
+ seconds_since_unix_epoch,
30
+ offset_in_seconds,
31
+ sign: offset_in_seconds.into(),
32
+ }
33
34
+
35
/// Serialize this instance to `out` in a format suitable for use in header fields of serialized git commits or tags.
36
pub fn write_to(&self, mut out: impl io::Write) -> io::Result<()> {
37
let mut itoa = itoa::Buffer::new();
0 commit comments