New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pkg/ottl] [Time] Add support for format and timezone #32140
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@michalpristas it seems that our docs for the We also should include in the I agree that we could add support for Would you like to work on this? |
yes, i believe this can be split in 2 PRs, one for doc one for locale |
@TylerHelmuth as go does not support localization of datetime by default, i'm considering pulling some 3rd party library. do you prefer internal implementation or something third party. I'm fine with both, implementation is not that difficult and we only need parsing part of that |
@michalpristas The library we are using now supports it. It's the same library stanza uses. |
you sure it supports locales? what i'm looking at is internal/coreinternal/timeutils/parser.go but i'm not finding support for locales such as maybe i'm just looking at the wrong place. i also went through go.mod dependencies but found nothing really |
You're right, I was thinking of the I agree we'd need to add a library or update |
|
Ahh, nevermind. I was looking at time zone considerations only. I agree if we want to translate between languages we'll need to add new functionality. |
thank you for looking into it, will work on adding functionality into our existing library as part of this issue |
my plan here is 4 PRs to keep them small:
will make sure docs update is part of every change |
**Description:** Updated docs for ottl converter so it includes more information about substitutes users can use Few examples with timezone handling were added **Link to tracking Issue:** #32140 **Testing:** no testing **Documentation:** --------- Co-authored-by: Curtis Robert <crobert@splunk.com> Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
**Description:** Updated docs for ottl converter so it includes more information about substitutes users can use Few examples with timezone handling were added **Link to tracking Issue:** open-telemetry#32140 **Testing:** no testing **Documentation:** --------- Co-authored-by: Curtis Robert <crobert@splunk.com> Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
**Description:** Added support for default timezone in Time converter. Timezone is optional and can be specified as so: `Time("2023-05-26 12:34:56", "%Y-%m-%d %H:%M:%S", "America/New_York")` **Link to tracking Issue:** #32140 **Testing:** Unit tests added **Documentation:** Documentation in ottl/Readme updated --------- Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
…ry#32479) **Description:** Added support for default timezone in Time converter. Timezone is optional and can be specified as so: `Time("2023-05-26 12:34:56", "%Y-%m-%d %H:%M:%S", "America/New_York")` **Link to tracking Issue:** open-telemetry#32140 **Testing:** Unit tests added **Documentation:** Documentation in ottl/Readme updated --------- Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
atm Time is simple and converts
string
totime.Time
Describe the solution you'd like
supporting custom
format
,timezone
seems like a must for some of my use casesand
locale
would be really nice to haveDescribe alternatives you've considered
No response
Additional context
No response
Tasks
The text was updated successfully, but these errors were encountered: