avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Missing time.h posix


From: Frédéric Nadeau
Subject: Re: [avr-libc-dev] Missing time.h posix
Date: Fri, 9 Oct 2009 14:07:42 -0400

I once had to write one for a project. It's not that complicated to
simply convert an 32 bit integer to a GTM time if you cut the corners.
Since we had no big requirements, here what we had not done:
- Leap seconds handling
- Timezone handling
- Localize printf

Basically we only had unix2struct, struct2unix and a print time function.

I think it would be hard to have a library that would match a UNIX
system. We were always a few second off from a computer but it didn't
cause any issue for us at the time.

if your interested i could post our code, mind you the time to string
function yield result in French, but that is just some constant string
to change.

At the time I was looking to do something decent for asctim() but then
it depends on where you are in the world for daylight saving as well
as the mood of the head of the country to decide to change the dates
at which saving day light is used. I know OpenBSD uses a file in /etc
to solve the issue. It's only 34bytes(fits well in either
ram/programspace/eeprom) but it's only for /Canada/Eastern. It became
quite complicated for our requirements at the time.

-- 
Frédéric Nadeau ing. jr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]