mirror of https://git.sr.ht/~statianzo/timeshift
commit
6f3221b799
@ -0,0 +1,27 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
scanner := bufio.NewScanner(os.Stdin)
|
||||||
|
for scanner.Scan() {
|
||||||
|
line := scanner.Text()
|
||||||
|
if len(line) < 9 {
|
||||||
|
fmt.Print("\n")
|
||||||
|
} else {
|
||||||
|
timestamp := line[0:9]
|
||||||
|
rest := line[9:]
|
||||||
|
parsed, err := time.Parse("0:04:05.0", timestamp)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
incremented := parsed.Add(11 * time.Second)
|
||||||
|
fmt.Printf("%s%s\n", incremented.Format("0:04:05.0"), rest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue