diff options
author | Marc Coquand <marc@mccd.space> | 2023-12-20 20:46:00 -0600 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2023-12-25 18:22:59 -0600 |
commit | 262f161f42c4e59beec41c6f440336c38385426a (patch) | |
tree | 6491c9b661a0b5a14c9a30ecf25e036f8762239d /lib/http_date.ml | |
parent | cc783c157f31e7e713c8b83be67449b1859dac27 (diff) | |
download | fixgen-262f161f42c4e59beec41c6f440336c38385426a.tar.gz fixgen-262f161f42c4e59beec41c6f440336c38385426a.tar.bz2 fixgen-262f161f42c4e59beec41c6f440336c38385426a.zip |
Initial commit
Diffstat (limited to '')
-rw-r--r-- | lib/http_date.ml | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/http_date.ml b/lib/http_date.ml deleted file mode 100644 index 38bda02..0000000 --- a/lib/http_date.ml +++ /dev/null @@ -1,37 +0,0 @@ -(* Taken from https://github.com/gopiandcode/ocamlot *) -let parse_date = Parser.parse_date -let parse_date_exn = Parser.parse_date_exn - -let to_utc_string t = - let www = - Ptime.weekday t |> function - | `Sat -> "Sat" - | `Fri -> "Fri" - | `Mon -> "Mon" - | `Wed -> "Wed" - | `Sun -> "Sun" - | `Tue -> "Tue" - | `Thu -> "Thu" - in - let (yyyy, mmm, dd), ((hh, mm, ss), _) = Ptime.to_date_time t in - let mmm = - match mmm with - | 1 -> "Jan" - | 2 -> "Feb" - | 3 -> "Mar" - | 4 -> "Apr" - | 5 -> "May" - | 6 -> "Jun" - | 7 -> "Jul" - | 8 -> "Aug" - | 9 -> "Sep" - | 10 -> "Oct" - | 11 -> "Nov" - | 12 -> "Dec" - | _ -> assert false - in - Printf.sprintf "%s, %02d %s %04d %02d:%02d:%02d GMT" www dd mmm yyyy hh mm ss - -let%test "rev" = - List.equal Int.equal (List.rev [ 3; 2; 1 ]) [ 3; 2; 1 ] - |