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

No access to timezone information #4038

Closed
vicuna opened this issue Jun 5, 2006 · 2 comments
Closed

No access to timezone information #4038

vicuna opened this issue Jun 5, 2006 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Jun 5, 2006

Original bug ID: 4038
Reporter: bhurt-aw
Status: closed (set by @mshinwell on 2016-12-06T22:03:36Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: @mmottl

Bug description

There is no access to the timezone information set by the tzset() function. Note that simply inspecting the TZ environment variable is not sufficient, as that variable may not be set (in which case the C library does implementation-specific methods to figure out the time zone).

The tzset(3) function is specificied by POSIX, as such, this is probably a good addition to the Unix module.

Additional information

Attached should be an example possible implementation to provide access to the timezone information. It has an iterface of:

external get_timezone : unit -> int = "get_timezone"

external get_daylight : unit -> int = "get_daylight"

external get_tzname : unit -> string array = "get_tzname"

File attachments

@vicuna
Copy link
Author

vicuna commented Jun 18, 2006

Comment author: spiralvoice

Ocaml-RSS, http://savannah.nongnu.org/cvs/?group=ocamlrss

has some code for computing local timezone, check Rss_date.localzone:

http://cvs.savannah.nongnu.org/viewcvs/ocamlrss/rss_date.ml?rev=1.1&root=ocamlrss&view=auto

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @mshinwell

Time zone functionality is complicated and probably does not belong in the standard distribution. The Jane Street Core libraries are one place where such support may be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant