mirror of https://git.sr.ht/~statianzo/timeshift
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
464 B
28 lines
464 B
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)
|
|
}
|
|
}
|
|
}
|