On Wed, Apr 11, 2018 at 3:23 PM, Martin Michlmayr <t...@cyrius.com> wrote:

> * Martin Blais <bl...@furius.ca> [2018-04-10 22:07]:
> > Any thoughts welcome. I lean toward (B), but I'm annoyed.
>
> Maybe I misunderstand the problem, but with option (A) even if I don't
> know what timezone they use, I should get a consistent result if I ask
> the API for an exchange rate for a specific time (X) on a specific
> day.


What do you mean by "consistent"?
Consistently one day off if it is?



>   Maybe I don't know what timezone X is (as you say, only one
> publishes that info), but X is always going to be X from the POV of
> the source (i.e. the API).  (Similarly, if I in Europe ask the API for
> a rate at, let's say, 14:00, and you in New York ask for the rate at
> 14:00, we should get the same result.

And I don't mean asking at
> 14:00 hours but asking for the rate at 14:00)
>

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?

It also depends how the API expects its input. If it expects a date, it's
implicitly that of the instruments.
If it expects a timestamp, there's no date, it's up to you to take the
user's input date and convert it to a timestamp, assuming some timezone.

Our current API doesn't support you providing a time, just a date.
You request for a price at a particular date.
The output is also coerced to be only a date too (the Price directive, like
all other directives, supports only a date).

(I don't think adding time support to all directives would be a reasonable
compromise just for this.)


If I understand (B) correctly, someone moving from Japan to the US
> would suddenly get different results,


Yes, the date might differ.


> and I think making the result
> dependent on where you are is a bad idea.
>

I agree, but then I need the timezone of those instruments, and some
instruments don't have a timezone (FX).

I don't think there's any good solution for this than to input/output time
from those fetchers, but I do need to choose how to convert timestamps to
dates and dates to timestamps consistently (that's why unit tests are
broken if you run them from Europe right now).


--
> 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 beancount+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/20180411192331.nnbpxcox6jepe3ro%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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhO261Mcqgk-vYhSyxWC69ep%3D5VtCeehjU7LDHxjTQkefg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to