Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Oct 22, 2021
Embed
What would you like to do?
package main
import (
"fmt"
"time"
)
func main() {
// https://parzibyte.me/blog
fecha := "2021-10-21T21:23:55"
fechaComoTime, err := time.Parse("2006-01-02T15:04:05", fecha)
if err == nil {
fmt.Println("Fecha parseada. Es:")
fmt.Println(fechaComoTime)
} else {
fmt.Println("Error:")
fmt.Println(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment