Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Edmo Vamerlatti Costa <[email protected]>
  • Loading branch information
odubajDT and edmocosta authored Jan 10, 2025
1 parent aee7584 commit 209e3e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .chloggen/ottl-timestamp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ change_type: enhancement
component: pkg/ottl

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Introduce new FormatTime() converter function."
note: "Add the `FormatTime` function to convert `time.Time` values to human-readable strings"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36870]
Expand All @@ -24,4 +24,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
change_logs: [user]
6 changes: 3 additions & 3 deletions pkg/ottl/ottlfuncs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1966,13 +1966,13 @@ Examples:

`FormatTime(time, format)`

The `FormatTime` Converter takes a `time.Time` and converts it to a human readable string representations of the time according to the specidied format.
The `FormatTime` Converter takes a `time.Time` and converts it to a human-readable string representation of the time according to the specified format.

`time` is `time.Time`. If `time` is another type an error is returned. `format` is a string.

If `format` is nil, an error is returned. The parser used is the parser at [internal/coreinternal/parser](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/coreinternal/timeutils). If `format` does not follow the parsing rules used by this parser, an error is returned.
If either `time` or `format` are nil, an error is returned. The parser used is the parser at [internal/coreinternal/parser](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/coreinternal/timeutils). If `format` does not follow the parsing rules used by this parser, an error is returned.

`format` denotes a textual and human readable representation of the resulting time value formatted according to ctime-like format string. It follows [standard Go Layout formatting](https://pkg.go.dev/time#pkg-constants) with few additional substitutes:
`format` denotes a human-readable textual representation of the resulting time value formatted according to ctime-like format string. It follows [standard Go Layout formatting](https://pkg.go.dev/time#pkg-constants) with few additional substitutes:
| substitution | description | examples |
|-----|-----|-----|
|`%Y` | Year as a zero-padded number | 0001, 0002, ..., 2019, 2020, ..., 9999 |
Expand Down

0 comments on commit 209e3e8

Please sign in to comment.