Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Confusion over UTC Time returned #598

@MarkLFT

Description

@MarkLFT

SDK you're using (please complete the following information):
Xero.NetStandard.OAuth2 11.0.0
Xero.NetStandard.OAuth2Client 1.6.0

Describe the bug
When I pull contacts from the demo system, the UpdateDateUTC field value is in the future. The current time and date here in Bali is 21 April 2025 15:25 GMT+8, but the records returned have a UpdateDateUTC of 21 April 2025 18:03:21 UTC, which would make local time 22 April 2025 04:04:21 GMT+8

This results in records being returned based on a LastUpdated filter being returned when they shouldn't be.

To Reproduce

var apiInstance = new AccountingApi();

DateTime? ifModifiedSince = null;

var when = await currentState.GetLastSyncContacts();

if (when.HasValue)
{
    ifModifiedSince = when.GetValueOrDefault().ToUniversalTime();
}

var xeroTenantId = "";
var result = await apiInstance.GetContactsAsync(token.AccessToken, xeroTenantId, ifModifiedSince, cancellationToken: ct);

Expected behavior
The date returned should have a correct UpdatedDateUTC that is correct and in the past.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions