Upload time is activity time

So I wanted create 365 days of fake data and upload it to Garmin connect.

I used java - created fit files.

I had to use Repair jar to upload it - files created by me doesn't work because they doesn't seems to contain all necessary info.

Every time that i upload it to webpage they don't preserve date - for example: Running activity is 18 September 2024 but on the website i see that i run on 24 November 2024 - upload date/ time.


Example csv 300 day file repaired:

Type,Local Number,Message,Field 1,Value 1,Units 1,Field 2,Value 2,Units 2,Field 3,Value 3,Units 3,Field 4,Value 4,Units 4,Field 5,Value 5,Units 5,Field 6,Value 6,Units 6,Field 7,Value 7,Units 7,Field 8,Value 8,Units 8,Field 9,Value 9,Units 9,
Definition,0,file_id,type,1,,manufacturer,1,,product,1,,serial_number,1,,time_created,1,,
Data,0,file_id,type,"4",,manufacturer,"255",,product,"0",,serial_number,"12345",,time_created,"1726690043",,
Definition,0,device_info,device_index,1,,manufacturer,1,,product,1,,product_name,21,,serial_number,1,,software_version,1,,timestamp,1,,
Data,0,device_info,device_index,"0",,manufacturer,"255",,product,"0",,product_name,"File Activity Repair",,serial_number,"123456789",,software_version,"1.0",,timestamp,"1726690043",s,
Definition,0,record,timestamp,1,,distance,1,,speed,1,,heart_rate,1,,,,,,,,,,,
Data,0,record,timestamp,"1726690043",s,distance,"0.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690061",s,distance,"50.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690079",s,distance,"100.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690097",s,distance,"150.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690115",s,distance,"200.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690133",s,distance,"250.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690151",s,distance,"300.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690169",s,distance,"350.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690187",s,distance,"400.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690205",s,distance,"450.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690223",s,distance,"500.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690241",s,distance,"550.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690259",s,distance,"600.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690277",s,distance,"650.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690295",s,distance,"700.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690313",s,distance,"750.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690331",s,distance,"800.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690349",s,distance,"850.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690367",s,distance,"900.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690385",s,distance,"950.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690403",s,distance,"1000.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690421",s,distance,"1050.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690439",s,distance,"1100.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690457",s,distance,"1150.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690475",s,distance,"1200.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690493",s,distance,"1250.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690511",s,distance,"1300.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690529",s,distance,"1350.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690547",s,distance,"1400.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690565",s,distance,"1450.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690583",s,distance,"1500.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690601",s,distance,"1550.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690619",s,distance,"1600.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690637",s,distance,"1650.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690655",s,distance,"1700.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690673",s,distance,"1750.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690691",s,distance,"1800.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690709",s,distance,"1850.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690727",s,distance,"1900.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690745",s,distance,"1950.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690763",s,distance,"2000.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690781",s,distance,"2050.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690799",s,distance,"2100.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690817",s,distance,"2150.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690835",s,distance,"2200.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690853",s,distance,"2250.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690871",s,distance,"2300.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690889",s,distance,"2350.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690907",s,distance,"2400.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690925",s,distance,"2450.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690943",s,distance,"2500.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690961",s,distance,"2550.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690979",s,distance,"2600.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726690997",s,distance,"2650.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691015",s,distance,"2700.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691033",s,distance,"2750.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691051",s,distance,"2800.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691069",s,distance,"2850.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691087",s,distance,"2900.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691105",s,distance,"2950.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691123",s,distance,"3000.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691141",s,distance,"3050.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691159",s,distance,"3100.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691177",s,distance,"3150.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691195",s,distance,"3200.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691213",s,distance,"3250.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691231",s,distance,"3300.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691249",s,distance,"3350.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691267",s,distance,"3400.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691285",s,distance,"3450.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691303",s,distance,"3500.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691321",s,distance,"3550.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691339",s,distance,"3600.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691357",s,distance,"3650.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691375",s,distance,"3700.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691393",s,distance,"3750.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691411",s,distance,"3800.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691429",s,distance,"3850.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691447",s,distance,"3900.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691465",s,distance,"3950.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691483",s,distance,"4000.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691501",s,distance,"4050.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691519",s,distance,"4100.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691537",s,distance,"4150.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691555",s,distance,"4200.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691573",s,distance,"4250.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691591",s,distance,"4300.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691609",s,distance,"4350.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691627",s,distance,"4400.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691645",s,distance,"4450.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691663",s,distance,"4500.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691681",s,distance,"4550.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691699",s,distance,"4600.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691717",s,distance,"4650.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691735",s,distance,"4700.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691753",s,distance,"4750.0",m,speed,"3.5",m/s,heart_rate,"140",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691771",s,distance,"4800.0",m,speed,"3.5",m/s,heart_rate,"141",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691789",s,distance,"4850.0",m,speed,"3.5",m/s,heart_rate,"142",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691807",s,distance,"4900.0",m,speed,"3.5",m/s,heart_rate,"143",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Data,0,record,timestamp,"1726691825",s,distance,"4950.0",m,speed,"3.5",m/s,heart_rate,"144",bpm,enhanced_speed,"3.5",m/s,,,,,,,
Definition,0,lap,message_index,1,,start_time,1,,timestamp,1,,total_elapsed_time,1,,total_timer_time,1,,total_distance,1,,,,,
Data,0,lap,message_index,"0",,start_time,"1726690043",,timestamp,"1726691825",s,total_elapsed_time,"1782.0",s,total_timer_time,"1782.0",s,total_distance,"4950.0",m,,,,
Definition,0,session,message_index,1,,start_time,1,,timestamp,1,,total_elapsed_time,1,,total_timer_time,1,,first_lap_index,1,,num_laps,1,,sport,1,,sub_sport,1,,
Data,0,session,message_index,"0",,start_time,"1726690043",,timestamp,"1726691825",s,total_elapsed_time,"1782.0",s,total_timer_time,"1782.0",s,first_lap_index,"0",,num_laps,"1",,sport,"0",,sub_sport,"0",,
Definition,0,activity,timestamp,1,,num_sessions,1,,local_timestamp,1,,total_timer_time,1,,,,,,,,,,,,,,,,,
Data,0,activity,timestamp,"1726691825",,num_sessions,"1",,local_timestamp,"1726695425",,total_timer_time,"1782.0",s,,,,,,,,,,,,,,,,


Java code that i had to repair using jar after generating fit file:

package com.garmin.fit.examples;
import com.garmin.fit.ActivityMesg;
import com.garmin.fit.DateTime;
import com.garmin.fit.DeveloperDataIdMesg;
import com.garmin.fit.DeveloperField;
import com.garmin.fit.DeviceIndex;
import com.garmin.fit.DeviceInfoMesg;
import com.garmin.fit.DisplayMeasure;
import com.garmin.fit.Event;
import com.garmin.fit.EventMesg;
import com.garmin.fit.EventType;
import com.garmin.fit.FieldDescriptionMesg;
import com.garmin.fit.File;
import com.garmin.fit.FileEncoder;
import com.garmin.fit.FileIdMesg;
import com.garmin.fit.Fit;
import com.garmin.fit.FitBaseType;
import com.garmin.fit.FitRuntimeException;
import com.garmin.fit.LapMesg;
import com.garmin.fit.LengthMesg;
import com.garmin.fit.LengthType;
import com.garmin.fit.Manufacturer;
import com.garmin.fit.Mesg;
import com.garmin.fit.MesgNum;
import com.garmin.fit.RecordMesg;
import com.garmin.fit.SessionMesg;
import com.garmin.fit.Sport;
import com.garmin.fit.SubSport;
import com.garmin.fit.SwimStroke;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TimeZone;
import java.util.Calendar;

public class RunningActivity {
    public static void main(String[] args) {
        try {

            String outputDir = "C:/FitSDK/";

            // Pierwszy trening 365 dni temu
            Calendar baseStartTime = Calendar.getInstance();
            baseStartTime.add(Calendar.DAY_OF_YEAR, -365);

            for (int day = 0; day < 365; day++) {
                String filename = outputDir + "Activity_Day_" + (day + 1) + ".fit";
                // Utwórz obiekt FileEncoder
                FileEncoder encoder = new FileEncoder(new java.io.File(filename));
                Calendar activityStartTime = (Calendar) baseStartTime.clone();
                activityStartTime.add(Calendar.DAY_OF_YEAR, day);

                long startTimestamp = activityStartTime.getTimeInMillis() / 1000;

                // DateTime startTime = new DateTime(new Date());
                // Dodaj File ID
                FileIdMesg fileIdMesg = new FileIdMesg();
                fileIdMesg.setType(File.ACTIVITY); // Typ pliku: Aktywność
                fileIdMesg.setManufacturer(Manufacturer.DEVELOPMENT);
                fileIdMesg.setProduct(0);
                fileIdMesg.setSerialNumber(12345L);
                fileIdMesg.setTimeCreated(new DateTime(startTimestamp));
                encoder.write(fileIdMesg);

                // Dodaj Sesję
                SessionMesg sessionMesg = new SessionMesg();
                sessionMesg.setSport(Sport.RUNNING); // Sport: Bieganie
                sessionMesg.setTotalDistance(5000f); // Dystans: 5 km
                sessionMesg.setTotalElapsedTime(1800f); // Czas trwania: 30 minut
                sessionMesg.setStartTime(new DateTime(startTimestamp)); // Start 30 minut temu
                encoder.write(sessionMesg);


                // Dodaj Rekordy (punkty danych)
                for (int i = 0; i < 100; i++) { // 100 punktów danych
                    RecordMesg recordMesg = new RecordMesg();
                    long recordTimestamp = startTimestamp + (i * 18); // Co 18 sekund
                    recordMesg.setTimestamp(new DateTime(recordTimestamp)); // Co 18 sekund
                    recordMesg.setDistance((float) (50 * i)); // Dystans w metrach
                    recordMesg.setSpeed(3.5f); // Prędkość w m/s (ok. 12,6 km/h)
                    recordMesg.setHeartRate((short) (140 + (i % 5))); // Tętno
                    encoder.write(recordMesg);
                }
                baseStartTime.add(Calendar.DAY_OF_YEAR, 1);
                System.out.println("Generated: " + filename);

                // Zakończ zapisywanie pliku
                encoder.close();
                System.out.println("Generated 365 days of FIT data in " + outputDir);
            }

        } catch (FitRuntimeException e) {
            System.err.println("Błąd podczas generowania pliku FIT: " + e.getMessage());
        }
    }
}