# Konvertues Unix timestamp

> Konvertoni kohën UNIX (timestamp) në datë e orë dhe anasjelltas. Shfaq timestamp-in aktual, kohën lokale, UTC dhe kohën relative. Shërbim falas online.

URL: https://acrafto.com/sq/konvertues-timestamp-unix/

Tools are interactive browser apps; there is no public API, no endpoints to call and no server-side processing. To use a tool, open its HTML page in a browser.

## Konvertues i Kohës UNIX (online)

Ky **konvertues i kohës UNIX (timestamp)** ju lejon të konvertoni shpejt **kohën UNIX (epoch time / POSIX time)** në **datë dhe orë** dhe anasjelltas. Ai mbështet **timestamp-in në sekonda dhe milisekonda**, shfaq **kohën lokale**, **UTC** dhe **ISO 8601**, dhe rezultatet mund të **kopjohen** me një klikim të vetëm.

---

## Çfarë është timestamp-i UNIX (epoch time / POSIX time)?

**Timestamp-i UNIX** është një numër që shpreh kohën si **numri i sekondave nga 1 janari 1970 00:00:00 UTC** (e ashtuquajtura **epoka UNIX**). Në praktikë, është një nga formatet më të përdorura për ruajtjen dhe transferimin e datës dhe kohës në sisteme, baza të të dhënave, API-të dhe logimet.

**Shembull:** `1700000000` korrespondon me datën **14 nëntor 2023 22:13:20 UTC**.

### Pse pikërisht 1 janar 1970?

Fillimi i epokës (1970-01-01) u zgjodh gjatë projektimit të UNIX-it si një pikë referimi praktike: është afër periudhës së krijimit të sistemit dhe mundëson llogaritje të thjeshta të kohës.

---

## Timestamp-i UNIX në sekonda kundrejt milisekondave

Timestamp-i UNIX zakonisht shfaqet në dy forma:

| Formati i timestamp-it | Shembull | Përdorimi tipik |
| --- | ---: | --- |
| **Sekonda (s)** | `1700000000` | baza të dhënash, backend, API, skedarë |
| **Milisekonda (ms)** | `1700000000000` | JavaScript (`Date.now()`), analiza, logje të detajuara |

**Si ta dalloni çfarë keni?**

- **Sekondat** për datat “sot” zakonisht kanë **10 shifra**.
- **Milisekondat** zakonisht kanë **13 shifra** dhe janë rreth **1000 herë më të mëdha**.
- Për orientim: nëse vlera është **\> 10¹²**, pothuajse me siguri janë **milisekonda**.

---

## Si të përdorni konvertuesin e kohës UNIX

### 1) Timestamp → Data dhe Ora

1. Futni **timestamp-in UNIX** në fushë, ose klikoni **Tani** (koha aktuale UNIX).
2. Nëse timestamp-i është në **milisekonda**, aktivizoni opsionin **Përdor Milisekonda**.
3. Klikoni **Konverto** (ose shtypni Enter).
4. Do të shfaqet konvertimi në **kohë lokale**, **UTC** dhe **ISO 8601**.
5. Duke klikuar mbi rezultat, do ta **kopjoni në clipboard**.

### 2) Data dhe Ora → Timestamp

1. Zgjidhni **datën dhe orën** në formular.
2. Klikoni **Konverto**.
3. Rezultatin do ta merrni si **timestamp në sekonda dhe milisekonda**.

---

## Ku përdoret më shpesh timestamp-i UNIX?

Kohën UNIX do ta hasni praktikisht kudo ku punohet me kohën në IT:

- **Baza të dhënash** – ruajtja dhe krahasimi i kohëve në MySQL, PostgreSQL, SQLite etj.
- **API** – REST/GraphQL shpesh kthejnë kohën si timestamp (serializim i lehtë).
- **Logje dhe monitorim** – renditje e saktë e ngjarjeve në kohë.
- **Git** – commit-et përmbajnë të dhëna kohore.
- **Sisteme skedarësh** – kohë si mtime/ctime/atime (modifikimi i fundit etj.).
- **JWT** – claim-et `iat` (issued at) dhe `exp` (expires) janë zakonisht në sekonda epoke.
- **Linux/Unix shell** – `date +%s` kthen timestamp-in aktual.
- **JavaScript** – `Date.now()` kthen kohën në **milisekonda**.

---

## Shembuj praktikë të konvertimit të kohës UNIX

### JavaScript (timestamp ↔ data)

```
// Timestamp-i aktual UNIX në sekonda
const tsSeconds = Math.floor(Date.now() / 1000);

// Timestamp-i aktual në milisekonda
const tsMs = Date.now();

// Timestamp (s) -> datë
const dateFromSeconds = new Date(1700000000 * 1000);
console.log(dateFromSeconds.toISOString());

// Datë -> timestamp (s)
const ts = Math.floor(new Date("2024-01-01T00:00:00Z").getTime() / 1000);
console.log(ts);
```

### Python (timestamp ↔ datetime)

```
import time
from datetime import datetime, timezone

# Timestamp-i aktual në sekonda
ts = int(time.time())

# Timestamp -> datetime (UTC)
dt_utc = datetime.fromtimestamp(1700000000, tz=timezone.utc)

# Datë -> timestamp
ts2 = int(datetime(2024, 1, 1, tzinfo=timezone.utc).timestamp())
```

### SQL (MySQL)

```
-- Timestamp-i aktual UNIX (s)
SELECT UNIX_TIMESTAMP();

-- Timestamp -> datë
SELECT FROM_UNIXTIME(1700000000);

-- Datë -> timestamp
SELECT UNIX_TIMESTAMP('2024-01-01 00:00:00');
```

---

## Zonat kohore: UTC, ora lokale dhe ISO 8601

**Timestamp-i UNIX është gjithmonë në UTC** – nuk përmban informacion për zonën kohore apo orën verore. Konvertimi në kohën lokale varet nga cilësimet e shfletuesit, serverit ose bibliotekës së përdorur.

Konceptet që vlejnë të dihen:

- **UTC** – standard global pa orë verore/dimërore.
- **GMT** – për përdorim të zakonshëm praktikisht e njëjtë me UTC.
- **Offset** – zhvendosja nga UTC (p.sh., Prishtina **UTC+1** në dimër, **UTC+2** në verë).

---

## Kufizimet e timestamp-it UNIX dhe Problemi i Vitit 2038

### Problemi i Vitit 2038 (Year 2038 Problem)

Në disa **sisteme 32-bitësh**, timestamp-i ruhet si `int32` me një maksimum prej **2 147 483 647**, që korrespondon me **19 janar 2038 03:14:07 UTC**. Pas tejkalimit, mund të ndodhë një tejmbushje dhe kohë e gabuar. Sistemet moderne **64-bitësh** zakonisht nuk e kanë këtë problem.

### Gama e kohës UNIX 64-bitëshe

Vlerat 64-bitëshe mbulojnë një periudhë jashtëzakonisht të gjerë (në praktikë “përgjithmonë”). Vlerat negative nënkuptojnë një datë **para 1 janarit 1970**.

---

## FAQ – Pyetje të shpeshta rreth timestamp-it UNIX

### \*\*A është timestamp-i UNIX në UTC, apo në orën lokale?\*\*

Timestamp-i UNIX është gjithmonë në \*\*UTC\*\*. Ora lokale krijohet vetëm gjatë konvertimit sipas zonës kohore. Prandaj, konvertuesi zakonisht shfaq si UTC ashtu edhe orën lokale.

### \*\*Si mund ta dalloj nëse timestamp-i është në sekonda apo milisekonda?\*\*

Për kohën aktuale, timestamp-i në \*\*sekonda\*\* zakonisht ka \*\*10 shifra\*\*. Në \*\*milisekonda\*\* zakonisht ka \*\*13 shifra\*\* dhe është rreth \*\*1000 herë më i madh\*\*. Për orientim: një vlerë \*\*> 10¹²\*\* zakonisht janë milisekonda.

### \*\*Çfarë do të thotë një timestamp UNIX negativ?\*\*

Një timestamp negativ përfaqëson një datë \*\*para 1 janarit 1970\*\*. Për shembull, \` -1\` korrespondon me \*\*31 dhjetor 1969 23:59:59 UTC\*\*.

### \*\*Si të konvertohet timestamp-i UNIX në SQL?\*\*

Në MySQL, do të përdorni \` FROM\_UNIXTIME(timestamp)\` dhe anasjelltas \` UNIX\_TIMESTAMP(data)\`. Në PostgreSQL, zakonisht është \` TO\_TIMESTAMP(timestamp)\` dhe \` EXTRACT(EPOCH FROM data)\`.

### \*\*Pse epoka UNIX fillon më 1 janar 1970?\*\*

Është një pikë referimi e zgjedhur historikisht nga ditët e hershme të UNIX-it: e thjeshtë, praktike dhe afër kohës së zhvillimit të sistemit.

## Other languages

- Čeština (cs): [Unix timestamp převodník](https://acrafto.com/cs/unix-timestamp/) ([Markdown](https://acrafto.com/cs/unix-timestamp/index.md))
- Slovenčina (sk): [Unix timestamp konvertor](https://acrafto.com/sk/unix-timestamp-prevodnik/) ([Markdown](https://acrafto.com/sk/unix-timestamp-prevodnik/index.md))
- English (en): [UNIX Timestamp Converter](https://acrafto.com/en/unix-timestamp-converter/) ([Markdown](https://acrafto.com/en/unix-timestamp-converter/index.md))
- Deutsch (de): [Unix Timestamp umrechnen](https://acrafto.com/de/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/de/unix-timestamp-konverter/index.md))
- Français (fr): [Convertisseur timestamp Unix](https://acrafto.com/fr/convertisseur-timestamp-unix/) ([Markdown](https://acrafto.com/fr/convertisseur-timestamp-unix/index.md))
- Español (es): [Convertidor de UNIX timestamp](https://acrafto.com/es/convertidor-timestamp-unix/) ([Markdown](https://acrafto.com/es/convertidor-timestamp-unix/index.md))
- Italiano (it): [Convertitore timestamp UNIX](https://acrafto.com/it/convertitore-timestamp-unix/) ([Markdown](https://acrafto.com/it/convertitore-timestamp-unix/index.md))
- Português (pt): [Conversor de timestamp Unix](https://acrafto.com/pt/conversor-timestamp-unix/) ([Markdown](https://acrafto.com/pt/conversor-timestamp-unix/index.md))
- Nederlands (nl): [Unix timestamp converter](https://acrafto.com/nl/unix-timestamp-converter/) ([Markdown](https://acrafto.com/nl/unix-timestamp-converter/index.md))
- Polski (pl): [Konwerter UNIX timestamp](https://acrafto.com/pl/konwerter-unix-timestamp/) ([Markdown](https://acrafto.com/pl/konwerter-unix-timestamp/index.md))
- Română (ro): [Convertor Unix timestamp](https://acrafto.com/ro/convertor-unix-timestamp/) ([Markdown](https://acrafto.com/ro/convertor-unix-timestamp/index.md))
- Magyar (hu): [UNIX időbélyeg konvertáló](https://acrafto.com/hu/unix-idobelyeg-atalakito/) ([Markdown](https://acrafto.com/hu/unix-idobelyeg-atalakito/index.md))
- Ελληνικά (el): [Μετατροπέας Unix timestamp](https://acrafto.com/el/unix-timestamp-converter/) ([Markdown](https://acrafto.com/el/unix-timestamp-converter/index.md))
- Български (bg): [Unix timestamp конвертор](https://acrafto.com/bg/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/bg/unix-timestamp-konverter/index.md))
- Hrvatski (hr): [Unix timestamp konverter](https://acrafto.com/hr/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/hr/unix-timestamp-konverter/index.md))
- Slovenščina (sl): [Pretvornik Unix timestamp](https://acrafto.com/sl/unix-timestamp-pretvornik/) ([Markdown](https://acrafto.com/sl/unix-timestamp-pretvornik/index.md))
- Eesti (et): [UNIX timestamp teisendaja](https://acrafto.com/et/unix-timestamp-teisendaja/) ([Markdown](https://acrafto.com/et/unix-timestamp-teisendaja/index.md))
- Latviešu (lv): [UNIX laika zīmogu pārveidotājs](https://acrafto.com/lv/unix-timestamp-konvertetajs/) ([Markdown](https://acrafto.com/lv/unix-timestamp-konvertetajs/index.md))
- Lietuvių (lt): [UNIX laiko žymės keitiklis](https://acrafto.com/lt/unix-laiko-zymes-keitiklis/) ([Markdown](https://acrafto.com/lt/unix-laiko-zymes-keitiklis/index.md))
- Svenska (sv): [Unix timestamp-omvandlare](https://acrafto.com/sv/unix-timestamp-omvandlare/) ([Markdown](https://acrafto.com/sv/unix-timestamp-omvandlare/index.md))
- Dansk (da): [UNIX timestamp konverter](https://acrafto.com/da/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/da/unix-timestamp-konverter/index.md))
- Suomi (fi): [UNIX-aikaleiman muunnin](https://acrafto.com/fi/unix-aikaleiman-muunnin/) ([Markdown](https://acrafto.com/fi/unix-aikaleiman-muunnin/index.md))
- Norsk (no): [Unix timestamp-konverterer](https://acrafto.com/no/unix-tidsstempel-konverterer/) ([Markdown](https://acrafto.com/no/unix-tidsstempel-konverterer/index.md))
- Українська (uk): [Конвертер Unix timestamp](https://acrafto.com/uk/konverter-unix-chasu/) ([Markdown](https://acrafto.com/uk/konverter-unix-chasu/index.md))
- Русский (ru): [Unix timestamp конвертер](https://acrafto.com/ru/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/ru/unix-timestamp-konverter/index.md))
- Српски (sr): [UNIX timestamp konverter](https://acrafto.com/sr/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/sr/unix-timestamp-konverter/index.md))
- Македонски (mk): [UNIX timestamp конвертор](https://acrafto.com/mk/unix-timestamp-konvertor/) ([Markdown](https://acrafto.com/mk/unix-timestamp-konvertor/index.md))
- Bosanski (bs): [Unix timestamp konverter](https://acrafto.com/bs/unix-timestamp-konverter/) ([Markdown](https://acrafto.com/bs/unix-timestamp-konverter/index.md))
- Türkçe (tr): [UNIX zaman damgası dönüştürücü](https://acrafto.com/tr/unix-zaman-damgasi-donusturucu/) ([Markdown](https://acrafto.com/tr/unix-zaman-damgasi-donusturucu/index.md))
- 日本語 (ja): [UNIXタイムスタンプ変換](https://acrafto.com/ja/unix-timestamp-converter/) ([Markdown](https://acrafto.com/ja/unix-timestamp-converter/index.md))
- 한국어 (ko): [유닉스 타임스탬프 변환기](https://acrafto.com/ko/unix-timestamp-converter/) ([Markdown](https://acrafto.com/ko/unix-timestamp-converter/index.md))
- العربية (ar): [محول Unix Timestamp](https://acrafto.com/ar/unix-timestamp-converter/) ([Markdown](https://acrafto.com/ar/unix-timestamp-converter/index.md))
- हिन्दी (hi): [UNIX टाइमस्टैम्प कनवर्टर](https://acrafto.com/hi/unix-timestamp-converter/) ([Markdown](https://acrafto.com/hi/unix-timestamp-converter/index.md))
- Bahasa Indonesia (id): [Konverter Unix timestamp](https://acrafto.com/id/konverter-timestamp-unix/) ([Markdown](https://acrafto.com/id/konverter-timestamp-unix/index.md))
- Tiếng Việt (vi): [Chuyển đổi Unix timestamp](https://acrafto.com/vi/bo-chuyen-doi-unix-timestamp/) ([Markdown](https://acrafto.com/vi/bo-chuyen-doi-unix-timestamp/index.md))
- ไทย (th): [แปลง Unix Timestamp](https://acrafto.com/th/unix-timestamp-converter/) ([Markdown](https://acrafto.com/th/unix-timestamp-converter/index.md))
- עברית (he): [ממיר Unix Timestamp](https://acrafto.com/he/unix-timestamp-converter/) ([Markdown](https://acrafto.com/he/unix-timestamp-converter/index.md))
