Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/mozilla/add-ons/webextensions/api/downloads/downloadtime/index.md
6581 views
---
title: downloads.DownloadTime slug: Mozilla/Add-ons/WebExtensions/API/downloads/DownloadTime page-type: webextension-api-type tags: - API - Add-ons - DownloadTime - Extensions - Non-standard - Reference - Type - WebExtensions - downloads browser-compat: webextensions.api.downloads.DownloadTime
---

{{AddonSidebar()}}

The DownloadTime type of the {{WebExtAPIRef("downloads")}} API represents the time a download took to complete.

Type

A DownloadTime can be one of three different types:

  • a JavaScript Date object.

  • a string:

    • if this contains only digits, it's interpreted as the number of milliseconds since the UNIX epoch.

    • otherwise, it's interpreted as an ISO 8601 string.

  • a number: this is interpreted as the number of milliseconds since the UNIX epoch.

Browser compatibility

{{Compat}}

{{WebExtExamples}}

Note: This API is based on Chromium's chrome.downloads API.