Package for analyzing dates in Common Lisp?

I am writing a simple web scraper in Common Lisp (SBCL) as a training exercise and would like to sort by date. To do this, I will need to parse the dates in the format "MM / DD / YYYY" at universal time.

I could just label the string and pass the bit to encode-universal-time , but I suppose there must be an inline function (or a popular third-party package) for parsing the date. I would really appreciate it if someone recommends :-)

+6
source share
5 answers

You can try net-telent-date , which has PARSE-TIME , which I think will do what you want.

Common Lisp Directory also has a list of libraries, some of which claim to be date-based.

+3
source

This answer is very late, but the local-time library is characteristic and widely used. It is based on the article A Long Painful History of Time .

supports :

  • Arithmetic of time and date
  • ISO 8601 timestring formatted output and parsing
  • Reader macros for embedding timestrings directly in code
  • Timezone processing (will read unix tzfile format)
  • Conversion between universal and time unix eras
  • Julian date calculation
+4
source

See net-telent-date and simple-date-time libraries for Common Lisp. The first has a parse-time function that you can use (see Parse-time.lisp). Both are included in the QuickLisp library.

+2
source

Many implementations have a UNIX interface, and in the same case, this includes the strptime function.

+1
source

Antik processes dates and times and includes date and time parsers. The result is a "time point", which by default is UTC (CL "universal-time" is something else, but it can be converted to this).

+1
source

Source: https://habr.com/ru/post/887107/


All Articles