nak event: fix created-at.

This commit is contained in:
fiatjaf 2023-05-03 19:49:07 -03:00
parent 2b08f66520
commit 56f3539d06
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -96,10 +96,12 @@ var event = &cli.Command{
} }
} }
createdAt := c.String("created_at") createdAt := c.String("created-at")
ts := time.Now() ts := time.Now()
if createdAt != "now" { if createdAt != "now" {
if v, err := strconv.ParseInt(createdAt, 10, 64); err != nil { if v, err := strconv.ParseInt(createdAt, 10, 64); err != nil {
return fmt.Errorf("failed to parse timestamp '%s': %w", createdAt, err)
} else {
ts = time.Unix(v, 0) ts = time.Unix(v, 0)
} }
} }