[Solved] How to check if one time.Now is after another time.Time [closed]


Here simple example how you can check it:

package main

import (
    "fmt"
    "time"
)

func main() {
    dateFormat := "2006-01-02"
    personCreatedAt, err := time.Parse(dateFormat, "2020-01-01")
    if err != nil {
        // error handling...
    }
    ok := time.Now().After(personCreatedAt)
    fmt.Println(ok)
}

Result will be: true

solved How to check if one time.Now is after another time.Time [closed]