Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created October 22, 2021 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/1a8cfac260c8d96e104462272243b960 to your computer and use it in GitHub Desktop.
Save parzibyte/1a8cfac260c8d96e104462272243b960 to your computer and use it in GitHub Desktop.
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