Skip to main content
Fleetwork
Fleetwork

Contact us

We look forward to hearing from you. Please fill out the form below.

APIReference

Date Formats

Date and time format conventions used in the Fleetwork API.

ISO 8601 (Timestamps)

All timestamp fields use ISO 8601 format in UTC:

Text
2026-04-15T08:30:00Z

Example fields: createdAt, updatedAt, completedAt, expiresAt

Date Only

Scheduled dates use the YYYY-MM-DD format:

Text
2026-04-15

Example fields: scheduledDate, fromDate, toDate

Epoch Milliseconds

GPS timestamps and time-range queries use epoch milliseconds:

Text
1713139200000

Example: GPS trail startTime and endTime query parameters.

Conversion Examples

JavaScript
// ISO 8601 → Date object
const date = new Date('2026-04-15T08:30:00Z');

// Epoch ms → Date object
const date2 = new Date(1713139200000);

// Date → Epoch ms
const epoch = date.getTime();

// Date → ISO string
const iso = date.toISOString();

Timezone

All API timestamps are in UTC (indicated by the Z suffix). Convert to local time in your client application:

JavaScript
const utcDate = new Date('2026-04-15T08:30:00Z');
const localString = utcDate.toLocaleString('vi-VN', {
  timeZone: 'Asia/Ho_Chi_Minh'
});
// "15/04/2026, 15:30:00" (UTC+7)