public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: "Bernard Fouché" <bernard.fouche@kuantic.com>
To: ecos-devel@ecos.sourceware.org
Subject: Re: Wallclock - calendar option
Date: Tue, 14 Feb 2012 14:45:00 -0000	[thread overview]
Message-ID: <4F3A7362.4000007@kuantic.com> (raw)
In-Reply-To: <3722057-9c72442ea03eee8ad26a7165c8bc15af@pmq2.m5r2.onet>


Le 14/02/2012 12:09, qber_ a écrit :
> Hello all.
> I want to discuss an option of Wallclock device framework.. Now the wallclock supports two option : init_get and set_get. This functions support time counted from 1970-01-01 00:00:00. The idea is to add the support for calendar insted of seconds counter. Most of applications uses calendar not seconds counter.
> The change for handling date and time for me is a result of working with STM32F2x processor which has calendar based RTC. The is no sense for converting calendar to seconds and then back again to calendar.
> The problem is which date and time format should be selected (if this change will be added to officail reposotory).
> Best Regards
> Qber
Hello Qber,

time_t (or any similar integer counter) is used everywhere inside CPUs, 
calendar time is used only to interface with entities externals to the 
MCU/CPU like humans, files/databases, network. Usually there is much 
more internal time calculations than time data output from a CPU in 
calendar representation. It's very hard to see any gain by using 
nightmarish calendar calculations when simple integer arithmetic can be 
used instead. Write a function that adds a variable amount of time to 
data represented as calendar date/time and compare it to an integer 
addition. Conversion functions between time_t and calendar date/time 
exist from 1970-01-01 00:00:00. Even Windows uses an integer 
representation, even probably the Maya as shown by their overflow 
problem at the end of the year.

     Bernard

      reply	other threads:[~2012-02-14 14:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 11:13 qber_
2012-02-14 14:45 ` Bernard Fouché [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F3A7362.4000007@kuantic.com \
    --to=bernard.fouche@kuantic.com \
    --cc=ecos-devel@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).