Skip to content

[Bug]: getting wrong timestamp #1644

@PFLTech

Description

@PFLTech

Required Reading

  • Confirmed

Plugin Version

flutter_background_geolocation: ^4.16.9

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.19045.6466], locale en-IN)
[√] Windows Version (10 Pro 64-bit, 22H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.21 (November 2025))
[√] Android Studio (version 2022.3)
[√] VS Code (version unknown)
    X Unable to determine VS Code version.
[√] Connected device (3 available)
[√] Network resources
 
! Doctor found issues in 1 category.

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

all

Device operating-systems(s)

all

What happened?

we are getting wrong time stamp. we received request on 2026-02-26 17:47:19.823 but in response we are getting 2026-02-25

{
"location": [
{
"event": "motionchange",
"is_moving": false,
"uuid": "824eb9a2-5bf6-4aac-882f-53a069880f3c",
"timestamp": "2026-02-25T11:43:21.946Z",
"age": 578,
"odometer": 1127672.5,
"coords": {
"latitude": 26.9141887,
"longitude": 75.8064139,
"accuracy": 4.3,
"speed": 0.01,
"speed_accuracy": 2.8,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 2.24,
"age": 604
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.6
},
"extras": {}
},
{
"event": "motionchange",
"is_moving": true,
"uuid": "7396b6b6-3073-4409-849e-9c2a2d31715b",
"timestamp": "2026-02-25T11:43:21.946Z",
"age": 1139,
"odometer": 1127672.5,
"coords": {
"latitude": 26.9141887,
"longitude": 75.8064139,
"accuracy": 4.3,
"speed": 0.01,
"speed_accuracy": 2.8,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 2.24,
"age": 1180
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.6
},
"extras": {}
},
{
"is_moving": true,
"uuid": "8a74ca49-31fd-45d2-860b-da2fcc0bd051",
"timestamp": "2026-02-25T11:43:23.374Z",
"age": 2845,
"odometer": 1127672.5,
"coords": {
"latitude": 26.9141885,
"longitude": 75.8064138,
"accuracy": 61.51,
"speed": 0.01,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 2.66,
"age": 2851
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.6
},
"extras": {}
},
{
"is_moving": true,
"uuid": "8cc0dc35-77d4-4792-bde4-0a9bf1a473c9",
"timestamp": "2026-02-25T11:43:23.374Z",
"age": 254737,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9141885,
"longitude": 75.8064138,
"accuracy": 61.51,
"speed": 0.01,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 2.66,
"age": 254745
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"is_moving": true,
"uuid": "452f7ecf-61ef-41f1-838d-8d6bedc6bb77",
"timestamp": "2026-02-25T11:44:22.948Z",
"age": 195265,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9143775,
"longitude": 75.8064517,
"accuracy": 4.02,
"speed": 0.35,
"speed_accuracy": 2.9,
"heading": 180,
"heading_accuracy": 57.6,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 1.77,
"age": 195272
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"is_moving": true,
"uuid": "aaaae511-97e0-473f-b97c-ef39cd89ae10",
"timestamp": "2026-02-25T11:47:39.030Z",
"age": 866,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9142373,
"longitude": 75.8064357,
"accuracy": 16.99,
"speed": -1,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": 45,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 2.48,
"age": 884
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"event": "motionchange",
"is_moving": false,
"uuid": "ddcc67d6-3e6f-4d35-b5a0-c79b0ce19cb2",
"timestamp": "2026-02-25T11:48:22.947Z",
"age": 973,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9143217,
"longitude": 75.8064067,
"accuracy": 3.32,
"speed": 0,
"speed_accuracy": 1.3,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 1.5,
"age": 986
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"event": "motionchange",
"is_moving": true,
"uuid": "48da119f-c367-43dc-bb66-e3af59238289",
"timestamp": "2026-02-25T11:48:22.947Z",
"age": 1184,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9143217,
"longitude": 75.8064067,
"accuracy": 3.32,
"speed": 0,
"speed_accuracy": 1.3,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 1.5,
"age": 1189
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"is_moving": true,
"uuid": "3db9244b-def7-437d-92e5-6d856582e75d",
"timestamp": "2026-02-25T11:48:29.467Z",
"age": 185,
"odometer": 1127693.8,
"coords": {
"latitude": 26.914249,
"longitude": 75.8064347,
"accuracy": 4.1,
"speed": 0.03,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 1.03,
"age": 189
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
},
{
"event": "motionchange",
"is_moving": true,
"uuid": "75ecc2ba-a545-4e35-87c0-3b8355e3205b",
"timestamp": "2026-02-25T11:48:36.968Z",
"age": 158,
"odometer": 1127693.8,
"coords": {
"latitude": 26.9142566,
"longitude": 75.8064333,
"accuracy": 4.3,
"speed": 0,
"speed_accuracy": 1.7,
"heading": -1,
"heading_accuracy": -1,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 1.17,
"age": 166
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.59
},
"extras": {}
}
],
"cmpId": "PINKCITY",
"EmpCode": "TPF-25-09-0303"
}
this is what we getting in.

and for another device response for creation date is 2026-02-26 12:37:34.443 in response we getting 2026-02-26

{
"location": [
{
"event": "motionchange",
"is_moving": true,
"uuid": "adc0973e-6cb1-4239-954a-c11bf32329b1",
"timestamp": "2026-02-26T03:57:30.651Z",
"age": 726,
"odometer": 26013.6,
"coords": {
"latitude": 26.9142333,
"longitude": 75.8055767,
"accuracy": 1.52,
"speed": 1.23,
"speed_accuracy": 1.1,
"heading": 115,
"heading_accuracy": 44.7,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 7.99,
"age": 737
},
"activity": {
"type": "walking",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.29
},
"extras": {}
},
{
"is_moving": true,
"uuid": "ab6ba9cb-f146-4b97-9033-424c9f13f8f8",
"timestamp": "2026-02-26T03:57:31.389Z",
"age": 96,
"odometer": 26015.8,
"coords": {
"latitude": 26.9142334,
"longitude": 75.8055988,
"accuracy": 1.83,
"speed": 1.33,
"speed_accuracy": 0.14,
"heading": 119.18,
"heading_accuracy": 9.65,
"altitude": 389.4,
"ellipsoidal_altitude": 389.4,
"altitude_accuracy": 7.99,
"age": 101
},
"activity": {
"type": "walking",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.29
},
"extras": {}
},
{
"is_moving": true,
"uuid": "f4c785f0-85e9-4a02-9985-4f207d14389d",
"timestamp": "2026-02-26T03:59:48.128Z",
"age": 168,
"odometer": 26094.4,
"coords": {
"latitude": 26.914092,
"longitude": 75.8063747,
"accuracy": 12.25,
"speed": 0.01,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": -1,
"altitude": 391.6,
"ellipsoidal_altitude": 391.6,
"altitude_accuracy": 1.03,
"age": 173
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.28
},
"extras": {}
},
{
"is_moving": true,
"uuid": "018a9fee-0068-4fda-8f1b-b3225dcf42f8",
"timestamp": "2026-02-26T07:03:16.856Z",
"age": 1516,
"odometer": 26094.4,
"coords": {
"latitude": 26.9141272,
"longitude": 75.8064298,
"accuracy": 13.83,
"speed": -1,
"speed_accuracy": 1.5,
"heading": -1,
"heading_accuracy": 45,
"altitude": 391.6,
"ellipsoidal_altitude": 391.6,
"altitude_accuracy": 1,
"age": 1525
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.22
},
"extras": {}
},
{
"is_moving": true,
"uuid": "e1974f6c-dd78-4446-bf3e-182e434c8627",
"timestamp": "2026-02-26T07:03:39.259Z",
"age": 178,
"odometer": 26094.4,
"coords": {
"latitude": 26.9141258,
"longitude": 75.8064254,
"accuracy": 13.78,
"speed": 0.62,
"speed_accuracy": 1.5,
"heading": 51.06,
"heading_accuracy": 45,
"altitude": 391.6,
"ellipsoidal_altitude": 391.6,
"altitude_accuracy": 1,
"age": 182
},
"activity": {
"type": "still",
"confidence": 100
},
"battery": {
"is_charging": false,
"level": 0.22
},
"extras": {}
}
],
"cmpId": "PINKCITY",
"EmpCode": "PFL-24-02-876"
}

why we getting time stamp different for many devices. our time time zone is IST. This issue we are getting on release mode.

Plugin Code and/or Config

bg.BackgroundGeolocation.ready(
  bg.Config(
    locationAuthorizationRequest: 'Always',
    disableLocationAuthorizationAlert: false,
    disableMotionActivityUpdates: false,
    // backgroundPermissionRationale: bg.PermissionRationale(
    //     title: "Give me Location bro",
    //     message: "I want you for testing",
    //     positiveAction: "Click here",
    //     negativeAction: "Don't click here"),
    // stationaryRadius: 200,
    // minimumActivityRecognitionConfidence: 75,
    desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
    distanceFilter: 250,
    // Set distance filter to 100 meters
    disableElasticity: true,
    stationaryRadius: 50,
    activityRecognitionInterval: 15000,
    speedJumpFilter: 25,
    preventSuspend: true,
    stopOnTerminate: false,
    startOnBoot: true,
    debug: false,
    allowIdenticalLocations: true,
    logLevel: bg.Config.LOG_LEVEL_VERBOSE,
    foregroundService: true,
    // forceReloadOnLocationChange: true,
    // geofenceModeHighAccuracy: true,
    // forceReloadOnGeofence: true,
    // forceReloadOnMotionChange: true,
    // isMoving: true,
    // locationUpdateInterval: 6000,
    enableHeadless: true,
    showsBackgroundLocationIndicator: false,
    stopOnStationary: false,
    pausesLocationUpdatesAutomatically: false,
    schedule: [],
    //new
    heartbeatInterval: 900,
    autoSyncThreshold: 5,
    batchSync: true,
    maxBatchSize: 10,
    // Server endpoint
    url: Common.domain + "",

    // Authorization header
    headers: header,

    // Parameters to send with each location
    params: {'EmpCode': widget.employeecode, 'cmpId': Common.cmpId, 'imeiNo': Common.getImeiNumber()},
    // extras: {
    //   "trackingId": trackingID,
    // },

    // Sync and HTTP settings
    autoSync: true,
    // Automatically send locations to the server
    method: 'POST', // HTTP POST method
  ),
)

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions