oto-zaman
v0.1.0
Published
Verilen milisaniyeyi veya timestamp değerini istenilen türe dönüştürür. Çoklu dil seçenekleri mevcuttur.
Downloads
22
Readme
Oto-zaman
Oto-zaman, tarih ve süre bulmaya yarayan, kullanımı kolay bir araçtır.
- Not: Eski sürüm (
z(süre, dil, tür)
ve büyük ihtimalz(süre, "tr", 3)
kullanmaktasınız) kullanıyorsanız yeni sürümdeki karşılığı:z.ms(süre, "tr", "str")
const z = require('oto-zaman');
z.sürüm; // -> oto-zaman sürümü
- Verilen timestamp değerinden tarihi bulabilir.
- Verilen milisaniye değerinden süreyi bulabilir.
- Verilen değerler
"tr"
(Türkçe) ve"en"
(İngilizce) olmak üzere iki dilde çıktı alınabilir. - Çıktı türleri
"obj"
(nesne) veya"str"
(yazı) şeklindedir.
| Dil ve çıktı için varsayılan değerler sırasıyla "tr"
ve "str"
dir.
Örnek
Milisaniye üzerinden
const z = require('oto-zaman');
z.ms(25000); // -> "25 saniye"
z.ms(25000, "tr"); // -> "25 saniye"
z.ms(25000, "en"); // -> "25 seconds"
z.ms(25000, "tr", "str"); // -> "25 saniye"
z.ms(357000, "en", "str"); // -> "5 minutes 57 seconds"
z.ms(25000, "tr", "obj"); // -> { yıl: 0, gün: 0, saat: 0, dakika: 0, saniye: 25 }
z.ms(357000, "tr", "obj"); // -> { yıl: 0, gün: 0, saat: 0 dakika: 5, saniye: 57 }
Timestamp değeri üzerinden
const z = require('oto-zaman');
timestamp = 1620931590036;
z.tarih(timestamp); // -> "13 Mayıs 2021 Perşembe"
z.tarih(timestamp, "tr"); // -> 13 Mayıs 2021 Perşembe
z.tarih(timestamp, "tr", "str"); // -> "13 Mayıs 2021 Perşembe"
z.tarih(timestamp, "tr", "obj"); // -> { gün: "13", ay: "Mayıs", yıl: "2021" }
z.tarih(timestamp, "en", "str"); // -> "13 May 2021"
z.tarih(timestamp, "en", "obj"); // -> { gün: "13", ay: "May", yıl: "2021" }