lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 19 March 2012 21:06, Alexander Gladysh <agladysh@gmail.com> wrote:
> On Tue, Mar 20, 2012 at 00:37, liam mail <liam.list@googlemail.com> wrote:
>> On 19 March 2012 20:15, Alexander Gladysh <agladysh@gmail.com> wrote:
>>> Hi, list!
>>>
>>> I'm looking for Lua analogue for this nice JS library:
>>> http://www.datejs.com/ (bindings to some C library would do)
>>>
>>> In particular I'm interested in date.parse() and date.parseExact() methods:
>>>
>>> http://code.google.com/p/datejs/wiki/APIDocumentation#parseExact
>>> http://code.google.com/p/datejs/wiki/APIDocumentation#parse
>>>
>>> ...but most other methods look useful too.
>>>
>>> Any clues?
>>>
>>> Any reusable C libraries for date.parse(), maybe?
>
>> strptime[1] or maybe another implementation such as [2] which is BSD
>
> How would this help me to parse "yesterday" or "week ago" as a date?
>
>> [1] http://linux.die.net/man/3/strptime
>> [2] http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/strptime.c?rev=HEAD
>
> https://github.com/agladysh/lua-getdate/blob/master/src/lua-getdate.c
>
> Alexander.
>

Well for them you could just adjust the tm struct which is ANSI.

@Alexandre Cool I did not know it was in luaposix.

Liam