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

Implement task-safe platform-indepent timezones #10480

Closed
klutzy opened this issue Nov 14, 2013 · 5 comments
Closed

Implement task-safe platform-indepent timezones #10480

klutzy opened this issue Nov 14, 2013 · 5 comments

Comments

@klutzy
Copy link
Contributor

klutzy commented Nov 14, 2013

Similar to #10463, extern::time::at() (which internally uses localtime()) currently depends on "TZ" environment variable, which causes setenv race.
Also its interpretation is also platform-dependent: linux libc understands TZ=America/Los_Angeles but Windows does not. (#10307)

We need:

  • Timezone type whose constructor may understand common time zone strings.
  • fn localtime(&self, utc_time) -> Tm method for Timezone. (This seems quite hard because it seems that there is no corresponding libc function)
  • For environment timezone, we may provide unsafe fn get_env_tz() -> Timezone.

I think this overlaps datetime design a bit, but anyway current implementation is "unsafe".

@huonw
Copy link
Member

huonw commented Nov 14, 2013

cc #2153, #2637.

@frewsxcv
Copy link
Member

frewsxcv commented Feb 3, 2015

The time module has moved to a separate repo https://github.com/rust-lang/time Should this Issue be moved there or is this an internal rustc component?

@klutzy
Copy link
Contributor Author

klutzy commented Feb 3, 2015

Yes, it's moved to time crate. (time::at() now)

@frewsxcv
Copy link
Member

frewsxcv commented Feb 3, 2015

Can this be closed then?

@Gankra
Copy link
Contributor

Gankra commented Feb 3, 2015

At best, this would be an RFC issue anyway.

@Gankra Gankra closed this as completed Feb 3, 2015
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 24, 2023
New lint to detect `&std::path::MAIN_SEPARATOR.to_string()`

Fixes rust-lang#10480

changelog: [`manual_main_separator_str`] new lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants