Skip to content
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

Add time_static attribute with time zone capabilities #33

Closed
OmerLaza opened this issue May 3, 2021 · 4 comments
Closed

Add time_static attribute with time zone capabilities #33

OmerLaza opened this issue May 3, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@OmerLaza
Copy link

OmerLaza commented May 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Hey, I've stated using basic TF and I've found the time_static very useful for timestamping resources creation time. We want to be able to timestamp our resources in timestamp that reflects our time zone (and not UTC).
So we want a time zone attribute for time_static similar to .rfc3339 but with option to add time zone to affect the output.

New or Affected Resource(s)

time_static time zone sensitive attribute.

Potential Terraform Configuration

resource "time_static" "createion_timestamp" {
  time_zone = "CET"
}

locals {
  common_tags {
    CreationDateTime = time_static.createion_timestamp.time_with_timezone
  }
}

References

https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations - list of time zone abbreviations

@OmerLaza OmerLaza added the enhancement New feature or request label May 3, 2021
@bflad
Copy link
Contributor

bflad commented May 4, 2021

Hi @OmerLaza 👋 Thank you for raising this feature request!

On the surface this may seem like a relatively straightforward problem, however timezones and associated data changes are actually a quite complex topic. For example, daylight savings times are regularly updated, there have been recent format changes to the underlying tzdata files used in some implementations, and often accessing this information is best through the platform specific implement of the execution environment rather than a purely programming language specific implementation. There is a lot of machinery behind the scenes managed by today's Operating System and programming language maintainers to keep the information up-to-date and valid.

All this is not to say that we would not consider anything in this space, it is just a complex area that might require additional design, implementation, and binary release work (e.g. enabling CGO on all platforms).

As a workaround for now, you may find pairing the timeadd() function with the formatdate() function (to hardcode the timezone format) acceptable. It will not be the prettiest solution, but hopefully something like that might get you going for now until further movement can be made on our end to make decisions about this.

@bflad
Copy link
Contributor

bflad commented Jun 28, 2021

Hi again, @OmerLaza 👋 Since we haven't heard back from you regarding the above, I'm going to close this out for now. Using the timeadd() and formatdate() functions in this situation should provide the necessary configuration to accomplish timezone handling.

@jeroenhabets
Copy link

^^ As I cannot reopen this request, I've logged #163

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants