Last Modified Date's Time is Returning Strange Values

I am using the last_modified_on field but for some reason it is telling me that my budget was modified at 3am. This is wrong even with the conversion to CDT.

11replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Nick Mosher - I just tried on my own budgets, and based on my timezone it appears the time returned is in UTC. Does that make sense based on the time you're seeing? I think 3 am  would correspond to 9 pm the day before if I'm understanding your time zone correctly (UTC-6).

    Reply Like
  • I wasn't clear. When I get the time it says:

    2018-02-09T09:39:12+00:00

    when converted to my time zone (UTC-6) it is 3:39am.

    Do think this has to do with bank sync or scheduled transactions?

    Reply Like
    • Nick Mosher Ah - I totally read that wrong. I'm going to dig in on this and get back to you! 

      Reply Like
  • Nick Mosher That's strange.  We only update this field when a client syncs to our server and data is updated.  The most likely explanation for this is that the mobile app is probably syncing to our servers while in the background (which they do occasionally).

    Reply Like
      • Nick Mosher
      • Designer
      • moshner
      • 1 yr ago
      • Reported - view

      Brady at YNAB I do have the mobile app installed on my Android phone. So, that theory might be accurate. 

      Reply Like
      • Nick Mosher
      • Designer
      • moshner
      • 1 yr ago
      • Reported - view

      Brady at YNAB I think it is off by 12 hours. I just updated my accounts at 5:12pm Central time and it is reporting "2018-02-16T11:12:05+00:00" aka 2/16/2018, 5:12 AM

      Reply Like
    • Nick Mosher When you say you updated your accounts, did you update them through the API or one of the clients (web/mobile)?

      Reply Like
      • Nick Mosher
      • Designer
      • moshner
      • 1 yr ago
      • Reported - view

      Brady at YNAB I used the web client

      Reply Like
    • Nick Mosher Strange!  I'm still not seeing this.   I am in CST timezone as well and did the following:

      1. I ran  curl https://api.youneedabudget.com/v1/budgets -H "Authorization: Bearer <ACCESS_TOKEN>" and noted the last_modified_on for the budget.

      2. Opened the web app and updated a budgeted value

      3. I ran curl https://api.youneedabudget.com/v1/budgets -H "Authorization: Bearer <ACCESS_TOKEN>" again and confirmed that the time updated.  In my case, it is 8:13 AM CST (14:13 UTC) and after I updated the budgeted amount I got back a last_modified_on value of 2018-02-19T14:13:38+00:00 (8:13 AM CST) which is what I would expect.

       

      If you're still seeing this, could you please try again and log your steps (like above) and post them here?

      Reply Like
      • Nick Mosher
      • Designer
      • moshner
      • 1 yr ago
      • Reported - view

      Brady at YNAB Have you considered that it might be a 24 hour clock vs 12 hour clock issue? I seem to be logging in and running my script in the afternoon when I see the issue. I haven't been able to log a test of this in the AM yet.

      1. Ran my script and got back the following values: lastAccessDate = 2018-02-17T08:08:13+00:00
      or cdt.lastAccessDate = 2/17/2018, 2:08 AM.

      2. Logged into my account via the web app and updated a budgeted value at 4:24 PM CDT

      3. Ran my script again and got back the following values: lastAccessDate = 2018-02-19T10:24:40+00:00
      cdt.lastAccessDate = 2/19/2018, 4:24 AM

      Here is my function:

      const getLastAccessedDate = () => {
        return api.budgets
        .getBudgetById(budgetId)
        .then(response => {
          const lastAccessDate = response.data.budget.last_modified_on;
          console.log('lastAccessDate = '+ lastAccessDate)
          results.lastAccessDate = new Date(lastAccessDate).toLocaleDateString('en-US', {
            hour: 'numeric',
            minute: 'numeric'
        });
        console.log('cdt.lastAccessDate = '+ cdt.lastAccessDate)
      })
      .catch(e => {
        console.log(`ERROR: ${JSON.stringify(e)}`);
      });

      };

      Reply Like
    • Nick Mosher I was able to reproduce - this is happening on the GET budgets/{budget_id} endpoint but not the GET /budgets endpoint.  I'll submit a fix for this.  Thanks for letting us know!

      Reply Like
Like Follow
  • Status Fixed
  • 1 yr agoLast active
  • 11Replies
  • 247Views
  • 3 Following