JavaScript Tanggal setUTCMinutes()
Contoh
Atur menit ke 17, menurut waktu UTC:
const d = new Date();
d.setUTCMinutes(17);
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Metode setUTCMinutes() menyetel menit dari objek tanggal, menurut UTC.
Catatan
UTC (Universal Time Coordinated) adalah waktu yang ditetapkan oleh Standar Waktu Dunia.
Waktu UTC sama dengan waktu GMT (Greenwich Mean Time).
Dukungan Peramban
setUTCMinutes()
adalah fitur ECMAScript1 (ES1).
ES1 (JavaScript 1997) didukung penuh di semua browser:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Date.setUTCMinutes(min, sec, millisec)
Nilai Parameter
Parameter | Description |
---|---|
min | Required. An integer representing the minutes.
Expected values are 0-59, but other values are allowed:
|
sec | Optional. An integer representing the seconds
Expected values are 0-59, but other values are allowed:
|
millisec | Optional. An integer representing the milliseconds
Expected values are 0-999, but other values are allowed:
|
Detail Teknis
Nilai Kembali: | Sebuah angka. Jumlah milidetik antara tanggal dan 1 Januari 1970 00:00:00 UTC. |
---|
Lebih Banyak Contoh
Contoh
Setel waktu tanggal menjadi 90 menit yang lalu , menggunakan metode UTC:
const d = new Date();
d.setUTCMinutes(d.getUTCMinutes() - 90);