(parse-date)

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
Excalibor
Posts: 47
Joined: Wed May 26, 2004 9:48 am
Location: Madrid, Spain

(parse-date)

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

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

Excalibor
Posts: 47
Joined: Wed May 26, 2004 9:48 am
Location: Madrid, Spain

Post by Excalibor »

Lutz wrote: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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

Lutz wrote: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

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
Posts: 47
Joined: Wed May 26, 2004 9:48 am
Location: Madrid, Spain

Post by Excalibor »

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!

Locked