fiorix / go-smpp

SMPP 3.4 Protocol for the Go programming language
MIT License
218 stars 135 forks source link

getValidityPeriod format YYMMDDhhmmssUTCR #115

Open parsibox opened 1 year ago

parsibox commented 1 year ago

hi we need another format for validity period update this with this code:


func convertValidityIrancell(d time.Duration) string {
    minutes := int(d / time.Minute)

    hours := minutes / 60
    minutes %= 60

    days := hours / 24
    hours %= 24
    //YYMMDDhhmmssUTCR
    formatted := fmt.Sprintf("%02d%02d%02d%02d%02d%02d000R",
        0, 0, days,
        hours, minutes, 0)

    return formatted
}