Hi Lars, Thanks for your response! I've done some research, and the formats I have seen all have their rigid formats (with a fixed length in particular) [1][2][3]. Would you mind pointing me to some exceptions? I can try to accommodate. That said, I'd argue it is still useful. It is much shorter, is flexible and customizable, and uses lisp sexprs instead of a DSL. Please feel free to let me know what it lacks of, I will try to work on it and present a final result. =) Cheers, Jin [1] https://common-lisp.net/project/local-time/manual.html#Parsing-and-Formatting [2] https://en.wikipedia.org/wiki/ISO_8601 [3] https://www.ibm.com/docs/en/spss-statistics/23.0.0?topic=formats-date-time On Sat, Jul 24, 2021 at 7:12 AM Lars Ingebrigtsen wrote: > "Guu, Jin-Cheng" writes: > > > Currently, the built-in time parsing functions only allow us to parse > > timestrings with respect to some given formats (ISO-8601, RFC-822) > > [1]. I have a parsing function that allows users to parse with > > customized formats which are easy to write. The end result is: > > > > ``` emacs-lisp > > (my/parse-time "20200718-201504" > > '((:year 4) (:month 2) (:day 2) "-" > > (:hour 2) (:minute 2) (:second 2))) > > ;; => ((:second . 4) (:minute . 15) (:hour . 20) > > ;; (:day . 18) (:month . 7) (:year . 2020)) > > ``` > > It's an interesting approach, but in my experience (having written > parsers for probably more than a hundred different time formats), this > doesn't really get you very far -- the formats often vary in length, use > month names, and so on, so you end up having to write tiny functions for > every format. > > So I'm not sure having something like this in Emacs would help that much. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no >