mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
nak event: fix created-at.
This commit is contained in:
parent
2b08f66520
commit
56f3539d06
4
event.go
4
event.go
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user