Skip to content

Commit

Permalink
slight change to string format in DisplayDateNow
Browse files Browse the repository at this point in the history
  • Loading branch information
kneerunjun committed Dec 29, 2020
1 parent 1d9a932 commit 29c3755
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions time.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package scheduling

import (
"fmt"
"strconv"
"time"
)

Expand Down Expand Up @@ -47,9 +48,9 @@ func ElapsedSecondsNow() int {
}

// DisplayDateNow : date and the time suitable for displays
// Like the blogs do it 28-Mar 1982 01:00:00
// Like the blogs do it 28-Mar'82 01:00:00
func DisplayDateNow() string {
yr, mn, dy := time.Now().Date()
hr, min, sec := time.Now().Clock()
return fmt.Sprintf("%d-%.3s %d %02d:%02d:%02d", dy, mn, yr, hr, min, sec)
return fmt.Sprintf("%d-%.3s'%s %02d:%02d:%02d", dy, mn, strconv.Itoa(yr)[2:], hr, min, sec)
}

0 comments on commit 29c3755

Please sign in to comment.