(t civil.Time, unit arrow.TimeUnit)
| 177 | } |
| 178 | |
| 179 | func stringForTime(t civil.Time, unit arrow.TimeUnit) string { |
| 180 | extra := "" |
| 181 | switch unit { |
| 182 | case arrow.Millisecond: |
| 183 | extra = fmt.Sprintf(".%03d", t.Nanosecond/1e6) |
| 184 | case arrow.Microsecond: |
| 185 | extra = fmt.Sprintf(".%06d", t.Nanosecond/1e3) |
| 186 | case arrow.Nanosecond: |
| 187 | extra = fmt.Sprintf(".%09d", t.Nanosecond) |
| 188 | } |
| 189 | return fmt.Sprintf("%02d:%02d:%02d"+extra, t.Hour, t.Minute, t.Second) |
| 190 | } |