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

strftime/strptime and asctime #3849

Closed
vicuna opened this issue Nov 8, 2005 · 4 comments
Closed

strftime/strptime and asctime #3849

vicuna opened this issue Nov 8, 2005 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Nov 8, 2005

Original bug ID: 3849
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: otherlibs
Parent of: #3851
Monitored by: @rixed warwick

Bug description

Full_Name: Joshua Smith
Version: 3.09
OS: Linux
Submission from: dsl092-167-152.wdc2.dsl.speakeasy.net (66.92.167.152)

I would like to have strftime/strptime and asctime added into the Unix module.
This functionality exists in non-standard modules but it would be nice to have a
more complete Unix module.

@vicuna
Copy link
Author

vicuna commented Nov 16, 2005

Comment author: administrator

see also #3851

@vicuna
Copy link
Author

vicuna commented Aug 10, 2011

Comment author: newacct

Yeah even the C90 standard library has asctime() and ctime(); why doesn't OCaml? Although you can convert between time and struct tm types, there is no way to get any of those into a string to display in OCaml, which is really silly.

@vicuna
Copy link
Author

vicuna commented Oct 29, 2012

Comment author: warwick

It'd be good to even have a basic time-to-string function such as asctime (though strftime/strptime would be ideal). These functions would be a handy addition to the Unix module.

Alternatively it could be good to add to the Printf module so that it can display floating point numbers (seconds since 1 Jan 1970) as date/times. This would be similar to Java, and quite useful:
%tY => year
%tm => month
%td => day
%tF => ISO 8601 date
etc

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

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