You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add utility functions around time package
Use Case
It would be helpful to have different utility functions revolving around time.Time in our library. For example, function to round to nearest interval, function to convert unix milli to time.Time, function to convert times to human-readable format, check occurrence/before/after of specific time, etc.
Pseudo Code
// Provide a code snippet or example that demonstrates how this feature might be usedfuncUnixMilliToTime(msint64) time.Time {
returntime.Unix(0, ms*int64(time.Millisecond))
}
funcSplitDuration(d time.Duration) (days, hours, minutes, secondsint) {
days=int(d.Hours()) /24hours=int(d.Hours()) %24minutes=int(d.Minutes()) %60seconds=int(d.Seconds()) %60return
}
The text was updated successfully, but these errors were encountered:
Feature Description
We should add utility functions around time package
Use Case
It would be helpful to have different utility functions revolving around time.Time in our library. For example, function to round to nearest interval, function to convert unix milli to time.Time, function to convert times to human-readable format, check occurrence/before/after of specific time, etc.
Pseudo Code
The text was updated successfully, but these errors were encountered: