On Sun, Apr 15, 2018 at 12:51 PM, Martin Michlmayr <[email protected]> wrote:

> * Martin Blais <[email protected]> [2018-04-11 16:29]:
> > You ask at 14:00 in which timezone? US 14:00 or Europe 14:00?
> > If you don't know the instrument trades in the US, you ask at 14:00 in
> > Europe timezone?
>
> Sorry, I thought you told the API "I want the exchange rate at 14:00
> time".  If so, we'd all get the same answer regardless of our local
> timezone.  It would be nice to know what the APIs timezone is so we
> know what "14:00" really means but that doesn't matter for beancount.


> If you only tell the API "I want the exchange rate now", then I think
> beancount should store the time in UTC.
>

If you store the timezone, there's no ambiguity.

I made a couple decisions staring at this long enough:

- The API will accept a time, not a date. bean-price will be in charge of
deciding how to convert that (and for now, using the local time, because
problems highlighted in prior discussion).

- All the datetime instances have to be aware. No more usage of naive
datetime instances anywhere. (I'm coming around to think that support naive
datetimes in the Python datetime module API is a design flaw.)




>
> > Our current API doesn't support you providing a time, just a date.
> > You request for a price at a particular date.
>
> Ok, (I think) I see the problem.
>
> If the API queried by beancount only provides 1 rate per day, we could
> easily find out what a "day" is according to them by doing a query
> every hour for 24 hours.
>
> Or just pick mid-day UTC.
>
> --
> Martin Michlmayr
> http://www.cyrius.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/20180415165103.zaixqwtthtn35fuu%40jirafa.cyrius.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhN6F7atoQ1ie7Mo_8FuUhw9hhogexL1a%2BpfcMpnOwOQ8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to