File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,20 @@ let format_date8hms =
131
131
put_2d s 12 t.tm_sec;
132
132
Bytes. unsafe_to_string s
133
133
134
+ (* * YYYY-MM-DD hh:mm:ss *)
135
+ let format_date8hms =
136
+ let template = " 2019-__-__ __:__:__" in
137
+ fun t ->
138
+ let open Unix in
139
+ let s = Bytes. of_string template in
140
+ replace_year_2019 s (t.tm_year + 1900 );
141
+ put_2d s 5 (t.tm_mon+ 1 );
142
+ put_2d s 8 t.tm_mday;
143
+ put_2d s 11 t.tm_hour;
144
+ put_2d s 14 t.tm_min;
145
+ put_2d s 17 t.tm_sec;
146
+ Bytes. unsafe_to_string s
147
+
134
148
(* * MMDD *)
135
149
let format_date4 t =
136
150
let open Unix in
@@ -154,6 +168,9 @@ let date8hm_string = format_date8hm $ Unix.localtime
154
168
let date8hms_gmt_string = format_date8hms $ Unix. gmtime
155
169
let date8hms_string = format_date8hms $ Unix. localtime
156
170
171
+ let basic_gmt_string = format_basic $ Unix. gmtime
172
+ let basic_string = format_basic $ Unix. localtime
173
+
157
174
let date4_gmt_string = format_date4 $ Unix. gmtime
158
175
let date4_string = format_date4 $ Unix. localtime
159
176
You can’t perform that action at this time.
0 commit comments