Money, dates and time zones
Two things are easy to get wrong in a CRM: money (rounding, currencies) and time (what “today” means). amabledata follows a few simple rules everywhere. Knowing them explains why a report and a dashboard can show slightly different totals for “yesterday”, and why an API amount of 1999 means 19.99.
Overview
Section titled “Overview”| Rule | Short version |
|---|---|
| Money is an integer | Every amount is stored in minor units (cents) next to an ISO 4217 currency code. |
| No conversion | amabledata never converts between currencies. Totals are always per currency. |
| One time zone per context | Times are stored as UTC instants and shown or grouped in a time zone chosen by the context: the workspace, the site, the report, the contact. |
| Days are local | A “day” in a report or dashboard runs from local midnight to local midnight in the chosen time zone. |
How it works
Section titled “How it works”Money in minor units
Section titled “Money in minor units”An amount is an integer number of the currency’s minor unit, never a decimal number:
| Currency | Minor-unit digits | 19.99 is stored as | Example |
|---|---|---|---|
| EUR, USD, GBP and most currencies | 2 | 1999 |
price_minor: 1999 = 19.99 |
| JPY, KRW, CLP, ISK, VND and others | 0 | — | price_minor: 1999 = ¥1,999 |
| BHD, IQD, JOD, KWD, LYD, OMR, TND | 3 | 19990 |
price_minor: 19990 = 19.990 |
In the REST API, money fields end with _minor (price_minor, unit_price_minor, subtotal_minor, discount_minor, tax_minor, shipping_minor, total_minor, amount_minor, analytics revenue_minor). The app shows them formatted in your language. The largest accepted amount is 100,000,000,000 minor units (one billion in major units for a two-decimal currency), which keeps integer arithmetic exact.
Tax rates are in basis points: 2200 means 22%, from 0 to 10000 (100%).
Currencies
Section titled “Currencies”- Codes are three uppercase letters from ISO 4217, limited to active circulating currencies (for example
EUR,USD,GBP,CHF,JPY). Fund codes, precious metals and test codes are not accepted. - Withdrawn codes (for example
HRK,SLL,ZWL,ANG,BGN,CUC) are rejected for new data: unknown or withdrawn ISO 4217 currency. - The workspace default currency (Settings › General › Default currency, same value as the e-commerce settings) is used for new products and orders. Default:
EUR. - Each analytics site has its own Currency, used for revenue on its dashboards. Default:
EUR. - A Currency custom field has its own currency setting.
No currency conversion
Section titled “No currency conversion”When records use several currencies, amabledata keeps them separate:
- Reports compute money measures for one currency at a time. The report builder’s Currency field defaults to the workspace currency (Empty = the workspace currency.). When the period also contains data in other currencies, the result says Money values cover
<currency>only; also data in:<list>. - Orders, payments and subscriptions keep their own currency forever.
Time is stored in UTC
Section titled “Time is stored in UTC”Every timestamp (creation dates, sends, events, payments) is stored as an absolute instant in UTC and shown in the time zone of the context. Two exceptions are calendar values without a time: birthdays, anniversaries and Date custom fields (YYYY-MM-DD) are civil dates with no time zone; they never shift. Date and time custom fields require an offset (Z or +02:00) and are stored as UTC.
Which time zone is used where
Section titled “Which time zone is used where”| Context | Time zone | Default | Where to set it |
|---|---|---|---|
| Workspace | Scheduled sends, dates in emails and automations, day boundaries of reports and dashboard widgets in the app | UTC |
Settings › General › Time zone |
| Automations | Timers, send windows and date triggers of contacts without a time zone (after the step, trigger and automation zones) | UTC |
Workspace time zone in any automation’s Automation settings (needs settings:manage); see Automations |
| Broadcast scheduled in each recipient’s time zone | The contact’s time zone, or the workspace’s when the contact has none (or an invalid one) | — | The contact’s time zone field |
| Analytics site | Day boundaries and hours on the site’s dashboards and insights | Your browser’s time zone when you create the site (API: UTC) |
Site Time zone |
| Reports run in the app (report page, builder preview, dashboard widgets, CSV export) | Day boundaries of the report | The workspace time zone | Settings › General › Time zone |
| Reports run through the API | Day boundaries | The timezone of the definition or of the request, otherwise UTC |
API parameter |
| Analytics queries through the API | Day boundaries | The timezone parameter, otherwise the site’s |
API parameter |
| Ad spend reconciliation | The day of the ad account | The ad account’s time zone (reconciled once a day from 03:00 local) | The ad platform |
Day boundaries in reports
Section titled “Day boundaries in reports”A report range is a list of whole local days, both ends included:
fromstarts at local midnight of the first day in the report’s time zone;toends at local midnight after the last day;- daylight saving changes are handled: a day can last 23 or 25 hours.
Presets are computed from today in that time zone:
| Preset | Range |
|---|---|
| Today | Today |
| Last 7 days | Today and the 6 days before |
| Last 30 days | Today and the 29 days before |
| Last 90 days | Today and the 89 days before |
| This month | The 1st of this month to today |
| Last month | The whole previous month |
| This quarter | The first day of this quarter to today |
| This year | 1 January to today |
| Last year | The whole previous year |
| Last 12 months (default) | The 1st of the month 11 months ago to today |
| All time | 1 January 2000 to today |
| Custom range | Your from and to dates |
With an Interval (granularity) of day, week or month, the range is split into buckets: weeks start on Monday, months on the 1st; the first and last bucket can be partial. A report can have at most 400 buckets (shorten the range or use a coarser granularity).
Comparisons: Previous period is the same number of days just before the range; Previous year is the same dates one year earlier (a date that does not exist one year earlier, such as 29 February, is clamped to the last day of that month).
Day boundaries in analytics
Section titled “Day boundaries in analytics”Analytics dashboards group by the site’s time zone. Query dates are YYYY-MM-DD in the query time zone (or full ISO date-times), and to is inclusive. Without dates, the API defaults to the last 7 days. Charts label each bucket in local time.
Step by step
Section titled “Step by step”Set the workspace time zone and currency
Section titled “Set the workspace time zone and currency”-
Open Settings › General › Regional settings.
-
Choose the Time zone (search a city, region or offset such as
UTC+2) and the Default currency. -
Save.
Changing the workspace time zone affects sends scheduled from then on, and the day boundaries of reports the next time they run; changing the currency affects new products and orders only.
Read a report in another time zone
Section titled “Read a report in another time zone”Reports in the app always use the workspace time zone, so two colleagues in different countries see the same totals for the same “Last 7 days”. To get the days of another time zone, run the report through the API with an explicit timezone.
Reference
Section titled “Reference”| Item | Value |
|---|---|
| Money format | Integer minor units + ISO 4217 code |
| Max amount | 100,000,000,000 minor units |
| Tax rate format | Basis points, 0–10000 |
| Default workspace currency | EUR |
| Default workspace time zone | UTC |
| Default site currency | EUR |
| Default report preset | Last 12 months |
| Week start | Monday |
| Max report buckets | 400 |
| Time zone names | IANA (Europe/Rome, America/New_York, UTC) |
Limits and permissions
Section titled “Limits and permissions”- Changing the workspace time zone and currency requires
settings:manage(Owner, Admin). - Changing a site’s time zone and currency requires
analytics:configure(Owner, Admin, Marketer).
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
| An API amount looks 100 times too big | Amounts are in minor units | Divide by 10 to the power of the currency’s digits. |
| unknown or withdrawn ISO 4217 currency | A withdrawn or invalid code | Use the current code (for example EUR instead of HRK). |
| expected an ISO 4217 code | Not three uppercase letters | Use EUR, not eur or €. |
| A report and the analytics dashboard disagree on “yesterday” | Workspace time zone (reports) versus site time zone (analytics) | Set the site Time zone to the workspace one, or compare in the same time zone. |
| Revenue in a report is lower than expected | Other currencies are excluded | Read the note listing the other currencies and run the report per currency. |
| more than 400 day buckets | Long range with a fine interval | Use week or month. |
| unknown timezone | Not a valid IANA name | Pick a value from the list. |

