Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Jan 22, 2023
1 parent e204c5a commit 6c7fbf5
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions docs/v2/examples/timestamp-flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,25 @@ When the layout doesn't contain timezones, timestamp will render with UTC. To
change behavior, a default timezone can be provided with flag definition:

```go
app := &cli.App{
Flags: []cli.Flag{
&cli.TimestampFlag{Name: "meeting", Layout: "2006-01-02T15:04:05", Timezone: time.Local},
},
package main

import (
"log"
"time"
"os"
"github.com/urfave/cli/v2"
)

func main() {
app := &cli.App{
Flags: []cli.Flag{
&cli.TimestampFlag{Name: "meeting", Layout: "2006-01-02T15:04:05", Timezone: time.Local},
},
}

if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}
```

Expand Down

0 comments on commit 6c7fbf5

Please sign in to comment.