Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aeghost/fmtime
Format time in OCaml, should be used with Fmt module
https://github.com/aeghost/fmtime
format ocaml time
Last synced: 20 days ago
JSON representation
Format time in OCaml, should be used with Fmt module
- Host: GitHub
- URL: https://github.com/aeghost/fmtime
- Owner: aeghost
- License: mit
- Created: 2024-05-21T09:20:31.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-21T10:42:42.000Z (9 months ago)
- Last Synced: 2024-11-21T05:43:24.720Z (3 months ago)
- Topics: format, ocaml, time
- Language: OCaml
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fmtime
Format time in OCaml, should be used with Fmt module
Exported to this github for save purpose (just in case I need it in the future)
## Usage
Use as fmt formatter - By default it uses 5424 standard
```ocaml
(* Use it as formatter *)
Fmt.pr "Now: %a@." Fmtime.RFC_5424.pp_now ()(* RFC 2822 is available for fellow Linuxians *)
Fmt.pr "1s after the zero as a linuxian: %a@." Fmtime.RFC_2822.pp 1.(* You can use as simple string if not confortable with Fmt *)
print_endline Fmtime.RFC_5424.(now ())
```## Tests
Run `make tests` to see it work (its just strings).