(parse-date)

Started by Excalibor, March 18, 2009, 06:17:33 AM

Previous topic - Next topic

Excalibor

Greetings,



I'm writing a script for parsing the output of the 'last' command, and I have found that (parse-date) gives an error. This is in 10.0.2 in Windows (both in newLISP GS and using it with cygwin)



> (sys-info)

(391 268435456 367 1 0 2048 3268 10002 6)

> (parse-date)



ERR: invalid function : (parse-date)



Is there something I'm overseeing or is it a bug in the Windows release? v10.0.2 on GNU/Linux works fine, though...



Thanks a bunch!

Lutz

#1
The 'parse-date' function is not available on Windows:



http://www.newlisp.org/newlisp_manual.html#parse-date">http://www.newlisp.org/newlisp_manual.html#parse-date

Excalibor

#2
Quote from: "Lutz"The 'parse-date' function is not available on Windows


That explains it all... Any reasons there's not one? Too hard to implement on windows, I guess...



I'll have to go manual with this one... :-P



thx anyway!

Lutz

#3
Although strptime(), the C function behind 'parse-date' is a POSIX function it is not supported on Windows. The public available C implementations are pretty big and typically made only for the English locale.



I suggest parsing the date string with newLISP using regular expressions and then feeding the values to the 'date-value' function.

xytroxon

#4
Quote from: "Lutz"Although strptime(), the C function behind 'parse-date' is a POSIX function it is not supported on Windows.


While this may sound like a strange problem not to have been addressed and fixed long ago, the PHP language strptime function also is NOT supported in the Windows version of PHP!!!



http://us2.php.net/strptime">//http://us2.php.net/strptime



And PHP has many more people working on their code ;)



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Excalibor

#5
Well, I see... it's a generalized WIndows problem...



Thanks for the advice, Lutz, I'll surely do as you say, it should be, anyway, easy enough...



laters!