util-tiempo
TypeScript icon, indicating that this package has built-in type declarations

1.0.52 • Public • Published

util-tiempo

util-tiempo es un módulo de utilidades para cálculos de tiempo y obtención de fechas seleccionables con diversas opciones.!



ADVERTENCIA:
Los tiempos deben estar en milisegundos. Si los tiempos están en segundos, simplemente multiplícalos por mil (*1000).

Funciones disponibles

Ejemplo

Aquí tienes un ejemplo de cómo puedes obtener los datos utilizando el código proporcionado.

Utilizaremos el siguiente timestamp como ejemplo para mostrar el formato de los datos obtenidos:
- Timestamp (segundos): 1146747723
- Timestamp (milisegundos): 1146747723000
- Fecha y hora (GMT): 4 de mayo de 2006 13:02:03

const {
  get,
  getMs,
  getTime,
  getDate,
  getCompareDate,
  getFormatDate,
} = require("util-tiempo");
// alternativa
import {
  get,
  getMs,
  getTime,
  getDate,
  getCompareDate,
  getFormatDate,
} from "util-tiempo";

// get() argumento ms / s / m / h / d / w / mh / y - 10/8/2021 15:17:10.242 GMT+02:00 DST
get("ms"); // resultado = '240'
get("s"); // resultado = '10'
get("m"); // resultado = '17'
get("h"); // resultado = '15'
get("d"); // resultado = '10'
get("w"); // resultado = '5'
get("mh"); // resultado = '8'
get("y"); // resultado = '2021'

// getMs() timestamp 1ms / 1s / 1m / 1h / 1d / 1w / 1mh / 1y
getMs("1ms"); // resultado = '1'
getMs("1s"); // resultado = '1000'
getMs("1m"); // resultado = '60000'
getMs("1h"); // resultado = '3600000'
getMs("1d"); // resultado = '86400000'
getMs("1w"); // resultado = '604800016'
getMs("1mh"); // resultado = '2629800000'
getMs("1y"); // resultado = '31557600000'

// getTime() por defecto  timeZone 'Europe/Madrid'
getTime(); // resultado = Hora actual en 'Europe/Madrid'
// getTime() timestamp new Date() - timeZone 'Atlantic/Canary'
getTime({ timezone: "Atlantic/Canary" }); // resultado = Hora actual en 'Atlantic/Canary'
// getTime() timestamp 1146747723000
getTime({ timestamp: 1146747723000 }); // resultado = '15:02:03'
// getTime() timestamp 1146747723000 - timeZone 'Atlantic/Canary'
getTime({ timestamp: 1146747723000, timeZone: "Atlantic/Canary" }); // resultado = '14:02:03'
// getTime() timestamp 1146747723000 - local en-US - timeZone 'America/New_York' - hour12 true
getTime({
  timestamp: 1146747723000,
  local: "en-US",
  timeZone: "America/New_York",
  hour12: true,
}); // resultado = '9:02:03 AM'

// getDate() por defecto timeZone 'Europe/Madrid'
getDate(); // resultado = Fecha actual en 'Europe/Madrid'
// getDate() timeZone 'Atlantic/Canary'
getDate({ timeZone: "Atlantic/Canary" }); // resultado = Fecha actual en 'Atlantic/Canary'
// getDate() timestamp 1146747723000
getDate({ timestamp: 1146747723000 }); // resultado = '04/05/2006'
// getDate() timestamp 1146747723000 - timeZone 'Atlantic/Canary'
getDate({ timestamp: 1146747723000, timeZone: "Atlantic/Canary" }); // resultado = '04/05/2006'
// getDate() timestamp 1146747723000 - local en-US - timeZone 'America/New_York'
getDate({
  timestamp: 1146747723000,
  local: "en-US",
  timeZone: "America/New_York",
}); // resultado = '5/4/2006'

// getCompareDate() timestamp(1) 76500000 - timestamp(2) por defecto new Date()
getCompareDate(76500000); // resultado = '21 horas 15 minutos'
// getCompareDate() timestamp(1) 1146747723 - timestamp(2) 1146747723 + 76500000
getCompareDate(1146747723, 1146747723 + 76500000); // resultado = '21 horas 15 minutos'

// getFormatDate() por defecto timeZone 'Europe/Madrid' - format DD/MM/YYYY hh:mm:ss
getFormatDate(); // resultado = Tiempo y fecha  actual en el formato 'DD/MM/YYYY hh:mm:ss' = '04/05/2006 15:02:03'
// getFormatDate() timestamp 1146747723000
getFormatDate({ timestamp: 1146747723000 }); // resultado = '04/05/2006 15:02:03'
// getFormatDate() format 15.02.03
getFormatDate({ timestamp: 1146747723000, format: "{hh}.{mm}.{ss}" }); // resultado = '15.02.03'
// getFormatDate() format 4-5-06
getFormatDate({ timestamp: 1146747723000, format: "{D}-{M}-{YY}" }); // resultado = '4-5-06'
// getFormatDate() timestamp 1146747723000 - timeZone 'America/New_York' - hour12 true - format 9:02:03 AM - 04/05/2006
getFormatDate({
  timestamp: 1146747723000,
  timeZone: "America/New_York",
  hour12: true,
  format: "{h}:{mm}:{ss} {apm} - {DD}/{MM}/{YYYY}",
}); // resultado = '9:02:03 AM - 04/05/2006'

Uso de las funciones

get(<argumento>)

DESCRIPCIÓN:
Esta función devuelve la unidad de tiempo especificada como argumento.

Puedes ver cómo se utilizan los argumentos en elejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • <argumento>
    • La unidad de tiempo {tiempo} que se desea obtener. Por ejemplo, para obtener el año actual 2023 debes de pasar como argumento y .
    • Unidades de tiempo admitidas:
      • Años: years, year, yrs, yr, y
      • Meses: months, month, mth, mh
      • Semanas: weeks, week, wk, w
      • Días: days, day, d
      • Horas: hours, hour, hrs, hr, h
      • Minutos: minutes, minute, mins, min, m
      • Segundos: seconds, second, secs, sec, s
      • Milisegundos: milliseconds, millisecond, msecs, msec, ms

getMs(<argumento>)

DESCRIPCIÓN:
Convierte la cantidad de tiempo que pasas como argumento en milisegundos.

Puedes ver como se usan los argumentos en el ejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • <argumento>
    • Añade la cantidad de tiempo deseada con su unidad de tiempo {num}{tiempo}. Por ejemplo, para que te devuelva la cantidad de milisegundos de 1 año debes de pasar como argumento 1y .
    • Si no añades la unidad de tiempo, el código reconocerá que la cantidad de tiempo es en milisegundos.
    • Unidades de tiempo:
      • Años: years, year, yrs, yr, y
      • Meses: months, month, mth, mh
      • Semanas: weeks, week, wk, w
      • Días: days, day, d
      • Horas: hours, hour, hrs, hr, h
      • Minutos: minutes, minute, mins, min, m
      • Segundos: seconds, second, secs, sec, s
      • Milisegundos: milliseconds, millisecond, msecs, msec, ms o no añadas la unidad de tiempo

getTime({timestamp: <tiempo>, local: <formato>, timeZone: <zonahoraria>, hour12: <true/false>})

DESCRIPCIÓN:
Este comando te devuelve la hora según el formato le hayas pasado.

Todos los argumentos son opcionales.
Puedes ver como se usan los argumentos en él ejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • timestamp: <tiempo> [OPCIONAL]
    • Si no se define estará tomando el tiempo actual.
    • El tiempo lo tienes que definir como timestamp, el código reconoce si está en milisegundos. Puedes obtener el timestamp de una fecha en concreta en esta página.
  • local: <formato> [OPCIONAL]
    • Puedes revisar la lista de formatos locales.
    • Si no se define este argumento, tomará el formato hh:mm:ss
  • timeZone: <zonahoraria> [OPCIONAL]
    • Puedes revisar la lista de zonas horarias.
    • Si no se define este argumento, tomará el tiempo de Europe/Madrid
  • hour12: <true/false> [OPCIONAL]
    • Si quieres que el formato de la hora sea en 12h, define este argumento como true.
    • Si quieres que el formato de la hora sea en 24h, no definas el argumento o defínelo como false.

getDate({timestamp: <tiempo>, local: <formato>, timeZone: <zonahoraria>})

DESCRIPCIÓN:
Este comando te devuelve la fecha según el formato le hayas pasado.

Todos los argumentos son opcionales.
Puedes ver como se usan los argumentos en el ejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • timestamp: <tiempo> [OPCIONAL]
    • Si no se define `estará tomando el tiempo actual.
    • El tiempo lo tienes que definir como timestamp, el código reconoce si está en milisegundos. Puedes obtener el timestamp de una fecha en concreta en esta página.
  • local: <formato> [OPCIONAL]
    • Puedes revisar la lista de formatos locales.
    • Si no se define este argumento, tomará el formato DD/MM/YYYY
  • timeZone: <zonahoraria> [OPCIONAL]
    • Puedes revisar la lista de zonas horarias.
    • Si no se define este argumento, tomará el tiempo de Europe/Madrid

getCompareDate({timestamp1: <tiempo1>, timestamp2: <tiempo2>, format: <formato>})

DESCRIPCIÓN:
Este comando te devuelve la diferencia entre dos fechas o cuanto tiempo son los milisegundos que le pasas.

El segundo tiempo es opcional.
Puedes ver como se usan los argumentos en el ejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • timestamp1: <tiempo1> [OPCIONAL]
    • El tiempo lo puedes definir como timestamp, este debe estar en milisegundos. Puedes obtener el timestamp de una fecha en concreta en esta página. También puedes añadirle una cantidad de milisegundos en concreto.
  • timestamp2: <tiempo2> [OPCIONAL]
    • El tiempo lo puedes definir como timestamp, este debe estar en milisegundos. Puedes obtener el timestamp de una fecha en concreta en esta página. También puedes añadirle una cantidad de milisegundos en concreto.
    • Si se define este argumento, el código calculará la diferencia entre los dos tiempos y te devolverá el resultado con la diferencia.
  • format: <formato> [OPCIONAL] Hacer - Puedes revisar la lista de formatos locales. - Si no se define este argumento, tomará el formato DD/MM/YYYY

getFormatDate({timestamp: <tiempo>, timeZone: <zonahoraria>, hour12: <true/false>, format: <formato>})

DESCRIPCIÓN:
Este comando te devuelve la fecha según el formato le hayas pasado.

Todos los argumentos son opcionales.
Puedes ver como se usan los argumentos en el ejemplo.
No incluyas los símbolos < > al especificar el argumento.

  • timestamp: <tiempo> [OPCIONAL]
    • Si no se define estará tomando el tiempo actual.
    • El tiempo lo tienes que definir como timestamp, el código reconoce si está en milisegundos. Puedes obtener el timestamp de una fecha en concreta en esta página.
  • timeZone: <zonahoraria> [OPCIONAL]
    • Puedes revisar la lista de zonas horarias.
    • Si no se define este argumento, tomará el tiempo de Europe/Madrid
  • hour12: <true/false> [OPCIONAL]
    • Si quieres que el formato de la hora sea en 12h, define este argumento como true.
    • Si quieres que el formato de la hora sea en 24h, no definas el argumento o defínelo como false.
  • format: <formato> [OPCIONAL]
    • Si no defines este argumento, por defecto te mostrará el tiempo en el formato DD/MM/YYYY hh:mm:ss.
    • Puedes definir el formato de la fecha que prefieras con las siguientes variables:
      • Hora: {hh} en dos dígitos, {h} en un dígito [01:02:03 => {hh} = '01', {h} = '1']
      • Minutos: {mm} en dos dígitos, {m} en un dígito [01:02:03 => {mm} = '02', {m} = '2']
      • Segundos: {ss} en dos dígitos, {s} en un dígito [01:02:03 => {ss} = '03', {s} = '3']
      • Día: {DD} en dos dígitos, {D} en un dígito [04/05/2006 => {DD} = '04', {D} = '4']
      • Mes: {MM} en dos dígitos, {M} en un dígito [04/05/2006 => {MM} = '05', {M} = '5']
      • Año: {YYYY} en cuatro dígitos, {YY} en dos dígitos [04/05/2006 => {YYYY} = '2006', {YY} = '06']
      • AM/PM: {apm} *Solo se mostrará si esta definido hour12: true
    • EJEMPLO: "{DD}/{MM}/{YYYY} {hh}:{mm}:{ss}". Este ejemplo es como se escribiría el formato que el código tiene por defecto.

Variables del tiempo

Formatos locales

[Mostrar/Ocultar]

4 de mayo de 2006 01:02:03 (24h)

local Time (24h) Time (12h) Date
ar-SA ٠١:٠٢:٠٣ ١:٠٢:٠٣ ص ٦‏/٤‏/١٤٢٧ هـ
bn-BD ০১:০২:০৩ ১:০২:০৩ AM ৪/৫/২০০৬
bn-IN ০১:০২:০৩ ১:০২:০৩ AM ৪/৫/২০০৬
cs-CZ 1:02:03 1:02:03 dop. 4. 5. 2006
da-DK 01.02.03 1.02.03 AM 4.5.2006
de-AT 01:02:03 1:02:03 AM 4.5.2006
de-CH 01:02:03 1:02:03 AM 4.5.2006
de-DE 01:02:03 1:02:03 AM 4.5.2006
el-GR 01:02:03 1:02:03 π.μ. 4/5/2006
en-AU 01:02:03 1:02:03 am 04/05/2006
en-CA 01:02:03 1:02:03 a.m. 2006-05-04
en-GB 01:02:03 1:02:03 am 04/05/2006
en-IE 01:02:03 1:02:03 a.m. 4/5/2006
en-IN 01:02:03 1:02:03 am 4/5/2006
en-NZ 01:02:03 1:02:03 am 4/05/2006
en-US 01:02:03 1:02:03 AM 5/4/2006
en-ZA 01:02:03 1:02:03 am 2006/05/04
es-AR 01:02:03 01:02:03 4/5/2006
es-CL 01:02:03 1:02:03 a. m. 04-05-2006
es-CO 1:02:03 1:02:03 a. m. 4/5/2006
es-ES 1:02:03 1:02:03 a. m. 4/5/2006
es-MX 1:02:03 1:02:03 a. m. 4/5/2006
es-US 01:02:03 1:02:03 a. m. 4/5/2006
fi-FI 1.02.03 1.02.03 ap. 4.5.2006
fr-BE 01:02:03 1:02:03 AM 04/05/2006
fr-CA 01 h 02 min 03 s 1 h 02 min 03 s a.m. 2006-05-04
fr-CH 01:02:03 1:02:03 AM 04.05.2006
fr-FR 01:02:03 1:02:03 AM 04/05/2006
he-IL 1:02:03 1:02:03 לפנה״צ 4.5.2006
hi-IN 01:02:03 1:02:03 am 4/5/2006
hu-HU 1:02:03 de. 1:02:03 2006. 05. 04.
id-ID 01.02.03 1.02.03 AM 4/5/2006
it-CH 01:02:03 1:02:03 AM 4/5/2006
it-IT 01:02:03 1:02:03 AM 4/5/2006
ja-JP 1:02:03 午前1:02:03 2006/5/4
ko-KR 1시 2분 3초 오전 1:02:03 2006. 5. 4.
nl-BE 01:02:03 1:02:03 a.m. 4/5/2006
nl-NL 01:02:03 1:02:03 a.m. 4-5-2006
no-NO 01:02:03 1:02:03 a.m. 4.5.2006
pl-PL 01:02:03 1:02:03 AM 4.05.2006
pt-BR 01:02:03 1:02:03 AM 04/05/2006
pt-PT 01:02:03 1:02:03 da manhã 04/05/2006
ro-RO 01:02:03 1:02:03 a.m. 04.05.2006
ru-RU 01:02:03 1:02:03 AM 04.05.2006
sk-SK 1:02:03 1:02:03 AM 4. 5. 2006
sv-SE 01:02:03 1:02:03 fm 2006-05-04
ta-IN 01:02:03 முற்பகல் 1:02:03 4/5/2006
ta-LK 01:02:03 முற்பகல் 1:02:03 4/5/2006
th-TH 01:02:03 1:02:03 ก่อนเที่ยง 4/5/2549
tr-TR 01:02:03 ÖÖ 1:02:03 04.05.2006
zh-CN 01:02:03 上午1:02:03 2006/5/4
zh-HK 01:02:03 上午1:02:03 4/5/2006
zh-TW 01:02:03 上午1:02:03 2006/5/4

Zonas horarias

[Mostrar/Ocultar]
timeZone Portion of country covered UTC offset ±hh:mm UTC DST offset ±hh:mm
Africa/Abidjan +00:00 +00:00
Africa/Accra +00:00 +00:00
Africa/Addis_Ababa +03:00 +03:00
Africa/Algiers +01:00 +01:00
Africa/Asmara +03:00 +03:00
Africa/Asmera +03:00 +03:00
Africa/Bamako +00:00 +00:00
Africa/Bangui +01:00 +01:00
Africa/Banjul +00:00 +00:00
Africa/Bissau +00:00 +00:00
Africa/Blantyre +02:00 +02:00
Africa/Brazzaville +01:00 +01:00
Africa/Bujumbura +02:00 +02:00
Africa/Cairo +02:00 +02:00
Africa/Casablanca +01:00 +00:00
Africa/Ceuta Ceuta, Melilla +01:00 +02:00
Africa/Conakry +00:00 +00:00
Africa/Dakar +00:00 +00:00
Africa/Dar_es_Salaam +03:00 +03:00
Africa/Djibouti +03:00 +03:00
Africa/Douala +01:00 +01:00
Africa/El_Aaiun +01:00 +00:00
Africa/Freetown +00:00 +00:00
Africa/Gaborone +02:00 +02:00
Africa/Harare +02:00 +02:00
Africa/Johannesburg +02:00 +02:00
Africa/Juba +02:00 +02:00
Africa/Kampala +03:00 +03:00
Africa/Khartoum +02:00 +02:00
Africa/Kigali +02:00 +02:00
Africa/Kinshasa Dem. Rep. of Congo (west) +01:00 +01:00
Africa/Lagos West Africa Time +01:00 +01:00
Africa/Libreville +01:00 +01:00
Africa/Lome +00:00 +00:00
Africa/Luanda +01:00 +01:00
Africa/Lubumbashi Dem. Rep. of Congo (east) +02:00 +02:00
Africa/Lusaka +02:00 +02:00
Africa/Malabo +01:00 +01:00
Africa/Maputo Central Africa Time +02:00 +02:00
Africa/Maseru +02:00 +02:00
Africa/Mbabane +02:00 +02:00
Africa/Mogadishu +03:00 +03:00
Africa/Monrovia +00:00 +00:00
Africa/Nairobi +03:00 +03:00
Africa/Ndjamena +01:00 +01:00
Africa/Niamey +01:00 +01:00
Africa/Nouakchott +00:00 +00:00
Africa/Ouagadougou +00:00 +00:00
Africa/Porto-Novo +01:00 +01:00
Africa/Sao_Tome +00:00 +00:00
Africa/Timbuktu +00:00 +00:00
Africa/Tripoli +02:00 +02:00
Africa/Tunis +01:00 +01:00
Africa/Windhoek +02:00 +02:00
America/Adak Aleutian Islands -10:00 -09:00
America/Anchorage Alaska (most areas) -09:00 -08:00
America/Anguilla -04:00 -04:00
America/Antigua -04:00 -04:00
America/Araguaina Tocantins -03:00 -03:00
America/Argentina/Buenos_Aires Buenos Aires (BA, CF) -03:00 -03:00
America/Argentina/Catamarca Catamarca (CT); Chubut (CH) -03:00 -03:00
America/Argentina/ComodRivadavia -03:00 -03:00
America/Argentina/Cordoba Argentina (most areas: CB, CC, CN, ER, FM, MN, SE, SF) -03:00 -03:00
America/Argentina/Jujuy Jujuy (JY) -03:00 -03:00
America/Argentina/La_Rioja La Rioja (LR) -03:00 -03:00
America/Argentina/Mendoza Mendoza (MZ) -03:00 -03:00
America/Argentina/Rio_Gallegos Santa Cruz (SC) -03:00 -03:00
America/Argentina/Salta Salta (SA, LP, NQ, RN) -03:00 -03:00
America/Argentina/San_Juan San Juan (SJ) -03:00 -03:00
America/Argentina/San_Luis San Luis (SL) -03:00 -03:00
America/Argentina/Tucuman Tucumán (TM) -03:00 -03:00
America/Argentina/Ushuaia Tierra del Fuego (TF) -03:00 -03:00
America/Aruba -04:00 -04:00
America/Asuncion -04:00 -03:00
America/Atikokan EST - ON (Atikokan); NU (Coral H) -05:00 -05:00
America/Atka -10:00 -09:00
America/Bahia Bahia -03:00 -03:00
America/Bahia_Banderas Central Time - Bahía de Banderas -06:00 -05:00
America/Barbados -04:00 -04:00
America/Belem Pará (east); Amapá -03:00 -03:00
America/Belize -06:00 -06:00
America/Blanc-Sablon AST - QC (Lower North Shore) -04:00 -04:00
America/Boa_Vista Roraima -04:00 -04:00
America/Bogota -05:00 -05:00
America/Boise Mountain - ID (south); OR (east) -07:00 -06:00
America/Buenos_Aires -03:00 -03:00
America/Cambridge_Bay Mountain - NU (west) -07:00 -06:00
America/Campo_Grande Mato Grosso do Sul -04:00 -04:00
America/Cancun Eastern Standard Time - Quintana Roo -05:00 -05:00
America/Caracas -04:00 -04:00
America/Catamarca -03:00 -03:00
America/Cayenne -03:00 -03:00
America/Cayman -05:00 -05:00
America/Chicago Central (most areas) -06:00 -05:00
America/Chihuahua Mountain Time - Chihuahua (most areas) -07:00 -06:00
America/Coral_Harbour -05:00 -05:00
America/Cordoba -03:00 -03:00
America/Costa_Rica -06:00 -06:00
America/Creston MST - BC (Creston) -07:00 -07:00
America/Cuiaba Mato Grosso -04:00 -04:00
America/Curacao -04:00 -04:00
America/Danmarkshavn National Park (east coast) +00:00 +00:00
America/Dawson MST - Yukon (west) -07:00 -07:00
America/Dawson_Creek MST - BC (Dawson Cr, Ft St John) -07:00 -07:00
America/Denver Mountain (most areas) -07:00 -06:00
America/Detroit Eastern - MI (most areas) -05:00 -04:00
America/Dominica -04:00 -04:00
America/Edmonton Mountain - AB; BC (E); SK (W) -07:00 -06:00
America/Eirunepe Amazonas (west) -05:00 -05:00
America/El_Salvador -06:00 -06:00
America/Ensenada -08:00 -07:00
America/Fort_Nelson MST - BC (Ft Nelson) -07:00 -07:00
America/Fort_Wayne -05:00 -04:00
America/Fortaleza Brazil (northeast: MA, PI, CE, RN, PB) -03:00 -03:00
America/Glace_Bay Atlantic - NS (Cape Breton) -04:00 -03:00
America/Godthab -03:00 -02:00
America/Goose_Bay Atlantic - Labrador (most areas) -04:00 -03:00
America/Grand_Turk -05:00 -04:00
America/Grenada -04:00 -04:00
America/Guadeloupe -04:00 -04:00
America/Guatemala -06:00 -06:00
America/Guayaquil Ecuador (mainland) -05:00 -05:00
America/Guyana -04:00 -04:00
America/Halifax Atlantic - NS (most areas); PE -04:00 -03:00
America/Havana -05:00 -04:00
America/Hermosillo Mountain Standard Time - Sonora -07:00 -07:00
America/Indiana/Indianapolis Eastern - IN (most areas) -05:00 -04:00
America/Indiana/Knox Central - IN (Starke) -06:00 -05:00
America/Indiana/Marengo Eastern - IN (Crawford) -05:00 -04:00
America/Indiana/Petersburg Eastern - IN (Pike) -05:00 -04:00
America/Indiana/Tell_City Central - IN (Perry) -06:00 -05:00
America/Indiana/Vevay Eastern - IN (Switzerland) -05:00 -04:00
America/Indiana/Vincennes Eastern - IN (Da, Du, K, Mn) -05:00 -04:00
America/Indiana/Winamac Eastern - IN (Pulaski) -05:00 -04:00
America/Indianapolis -05:00 -04:00
America/Inuvik Mountain - NT (west) -07:00 -06:00
America/Iqaluit Eastern - NU (most east areas) -05:00 -04:00
America/Jamaica -05:00 -05:00
America/Jujuy -03:00 -03:00
America/Juneau Alaska - Juneau area -09:00 -08:00
America/Kentucky/Louisville Eastern - KY (Louisville area) -05:00 -04:00
America/Kentucky/Monticello Eastern - KY (Wayne) -05:00 -04:00
America/Knox_IN -06:00 -05:00
America/Kralendijk -04:00 -04:00
America/La_Paz -04:00 -04:00
America/Lima -05:00 -05:00
America/Los_Angeles Pacific -08:00 -07:00
America/Louisville -05:00 -04:00
America/Lower_Princes -04:00 -04:00
America/Maceio Alagoas, Sergipe -03:00 -03:00
America/Managua -06:00 -06:00
America/Manaus Amazonas (east) -04:00 -04:00
America/Marigot -04:00 -04:00
America/Martinique -04:00 -04:00
America/Matamoros Central Time US - Coahuila, Nuevo León, Tamaulipas (US border) -06:00 -05:00
America/Mazatlan Mountain Time - Baja California Sur, Nayarit, Sinaloa -07:00 -06:00
America/Mendoza -03:00 -03:00
America/Menominee Central - MI (Wisconsin border) -06:00 -05:00
America/Merida Central Time - Campeche, Yucatán -06:00 -05:00
America/Metlakatla Alaska - Annette Island -09:00 -08:00
America/Mexico_City Central Time -06:00 -05:00
America/Miquelon -03:00 -02:00
America/Moncton Atlantic - New Brunswick -04:00 -03:00
America/Monterrey Central Time - Durango; Coahuila, Nuevo León, Tamaulipas (most areas) -06:00 -05:00
America/Montevideo -03:00 -03:00
America/Montreal -05:00 -04:00
America/Montserrat -04:00 -04:00
America/Nassau -05:00 -04:00
America/New_York Eastern (most areas) -05:00 -04:00
America/Nipigon Eastern - ON, QC (no DST 1967-73) -05:00 -04:00
America/Nome Alaska (west) -09:00 -08:00
America/Noronha Atlantic islands -02:00 -02:00
America/North_Dakota/Beulah Central - ND (Mercer) -06:00 -05:00
America/North_Dakota/Center Central - ND (Oliver) -06:00 -05:00
America/North_Dakota/New_Salem Central - ND (Morton rural) -06:00 -05:00
America/Nuuk Greenland (most areas) -03:00 -02:00
America/Ojinaga Mountain Time US - Chihuahua (US border) -07:00 -06:00
America/Panama -05:00 -05:00
America/Pangnirtung Eastern - NU (Pangnirtung) -05:00 -04:00
America/Paramaribo -03:00 -03:00
America/Phoenix MST - Arizona (except Navajo) -07:00 -07:00
America/Port-au-Prince -05:00 -04:00
America/Port_of_Spain -04:00 -04:00
America/Porto_Acre -05:00 -05:00
America/Porto_Velho Rondônia -04:00 -04:00
America/Puerto_Rico -04:00 -04:00
America/Punta_Arenas Region of Magallanes -03:00 -03:00
America/Rainy_River Central - ON (Rainy R, Ft Frances) -06:00 -05:00
America/Rankin_Inlet Central - NU (central) -06:00 -05:00
America/Recife Pernambuco -03:00 -03:00
America/Regina CST - SK (most areas) -06:00 -06:00
America/Resolute Central - NU (Resolute) -06:00 -05:00
America/Rio_Branco Acre -05:00 -05:00
America/Rosario -03:00 -03:00
America/Santa_Isabel -08:00 -07:00
America/Santarem Pará (west) -03:00 -03:00
America/Santiago Chile (most areas) -04:00 -03:00
America/Santo_Domingo -04:00 -04:00
America/Sao_Paulo Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS) -03:00 -03:00
America/Scoresbysund Scoresbysund/Ittoqqortoormiit -01:00 +00:00
America/Shiprock -07:00 -06:00
America/Sitka Alaska - Sitka area -09:00 -08:00
America/St_Barthelemy -04:00 -04:00
America/St_Johns Newfoundland; Labrador (southeast) -03:30 -02:30
America/St_Kitts -04:00 -04:00
America/St_Lucia -04:00 -04:00
America/St_Thomas -04:00 -04:00
America/St_Vincent -04:00 -04:00
America/Swift_Current CST - SK (midwest) -06:00 -06:00
America/Tegucigalpa -06:00 -06:00
America/Thule Thule/Pituffik -04:00 -03:00
America/Thunder_Bay Eastern - ON (Thunder Bay) -05:00 -04:00
America/Tijuana Pacific Time US - Baja California -08:00 -07:00
America/Toronto Eastern - ON, QC (most areas) -05:00 -04:00
America/Tortola -04:00 -04:00
America/Vancouver Pacific - BC (most areas) -08:00 -07:00
America/Virgin -04:00 -04:00
America/Whitehorse MST - Yukon (east) -07:00 -07:00
America/Winnipeg Central - ON (west); Manitoba -06:00 -05:00
America/Yakutat Alaska - Yakutat -09:00 -08:00
America/Yellowknife Mountain - NT (central) -07:00 -06:00
Antarctica/Casey Casey +11:00 +11:00
Antarctica/Davis Davis +07:00 +07:00
Antarctica/DumontDUrville Dumont-d'Urville +10:00 +10:00
Antarctica/Macquarie Macquarie Island +10:00 +11:00
Antarctica/Mawson Mawson +05:00 +05:00
Antarctica/McMurdo New Zealand time - McMurdo, South Pole +12:00 +13:00
Antarctica/Palmer Palmer -03:00 -03:00
Antarctica/Rothera Rothera -03:00 -03:00
Antarctica/South_Pole +12:00 +13:00
Antarctica/Syowa Syowa +03:00 +03:00
Antarctica/Troll Troll +00:00 +02:00
Antarctica/Vostok Vostok +06:00 +06:00
Arctic/Longyearbyen +01:00 +02:00
Asia/Aden +03:00 +03:00
Asia/Almaty Kazakhstan (most areas) +06:00 +06:00
Asia/Amman +02:00 +03:00
Asia/Anadyr MSK+09 - Bering Sea +12:00 +12:00
Asia/Aqtau Mangghysta-/Mankistau +05:00 +05:00
Asia/Aqtobe Aqtöbe/Aktobe +05:00 +05:00
Asia/Ashgabat +05:00 +05:00
Asia/Ashkhabad +05:00 +05:00
Asia/Atyrau Atyra-/Atirau/Gur'yev +05:00 +05:00
Asia/Baghdad +03:00 +03:00
Asia/Bahrain +03:00 +03:00
Asia/Baku +04:00 +04:00
Asia/Bangkok Indochina (most areas) +07:00 +07:00
Asia/Barnaul MSK+04 - Altai +07:00 +07:00
Asia/Beirut +02:00 +03:00
Asia/Bishkek +06:00 +06:00
Asia/Brunei +08:00 +08:00
Asia/Calcutta +05:30 +05:30
Asia/Chita MSK+06 - Zabaykalsky +09:00 +09:00
Asia/Choibalsan Dornod, Sükhbaatar +08:00 +08:00
Asia/Chongqing +08:00 +08:00
Asia/Chungking +08:00 +08:00
Asia/Colombo +05:30 +05:30
Asia/Dacca +06:00 +06:00
Asia/Damascus +02:00 +03:00
Asia/Dhaka +06:00 +06:00
Asia/Dili +09:00 +09:00
Asia/Dubai +04:00 +04:00
Asia/Dushanbe +05:00 +05:00
Asia/Famagusta Northern Cyprus +02:00 +03:00
Asia/Gaza Gaza Strip +02:00 +03:00
Asia/Harbin +08:00 +08:00
Asia/Hebron West Bank +02:00 +03:00
Asia/Ho_Chi_Minh Vietnam (south) +07:00 +07:00
Asia/Hong_Kong +08:00 +08:00
Asia/Hovd Bayan-Ölgii, Govi-Altai, Hovd, Uvs, Zavkhan +07:00 +07:00
Asia/Irkutsk MSK+05 - Irkutsk, Buryatia +08:00 +08:00
Asia/Istanbul +03:00 +03:00
Asia/Jakarta Java, Sumatra +07:00 +07:00
Asia/Jayapura New Guinea (West Papua / Irian Jaya); Malukus/Moluccas +09:00 +09:00
Asia/Jerusalem +02:00 +03:00
Asia/Kabul +04:30 +04:30
Asia/Kamchatka MSK+09 - Kamchatka +12:00 +12:00
Asia/Karachi +05:00 +05:00
Asia/Kashgar +06:00 +06:00
Asia/Kathmandu +05:45 +05:45
Asia/Katmandu +05:45 +05:45
Asia/Khandyga MSK+06 - Tomponsky, Ust-Maysky +09:00 +09:00
Asia/Kolkata +05:30 +05:30
Asia/Krasnoyarsk MSK+04 - Krasnoyarsk area +07:00 +07:00
Asia/Kuala_Lumpur Malaysia (peninsula) +08:00 +08:00
Asia/Kuching Sabah, Sarawak +08:00 +08:00
Asia/Kuwait +03:00 +03:00
Asia/Macao +08:00 +08:00
Asia/Macau +08:00 +08:00
Asia/Magadan MSK+08 - Magadan +11:00 +11:00
Asia/Makassar Borneo (east, south); Sulawesi/Celebes, Bali, Nusa Tengarra; Timor (west) +08:00 +08:00
Asia/Manila +08:00 +08:00
Asia/Muscat +04:00 +04:00
Asia/Nicosia Cyprus (most areas) +02:00 +03:00
Asia/Novokuznetsk MSK+04 - Kemerovo +07:00 +07:00
Asia/Novosibirsk MSK+04 - Novosibirsk +07:00 +07:00
Asia/Omsk MSK+03 - Omsk +06:00 +06:00
Asia/Oral West Kazakhstan +05:00 +05:00
Asia/Phnom_Penh +07:00 +07:00
Asia/Pontianak Borneo (west, central) +07:00 +07:00
Asia/Pyongyang +09:00 +09:00
Asia/Qatar +03:00 +03:00
Asia/Qostanay Qostanay/Kostanay/Kustanay +06:00 +06:00
Asia/Qyzylorda Qyzylorda/Kyzylorda/Kzyl-Orda +05:00 +05:00
Asia/Rangoon +06:30 +06:30
Asia/Riyadh +03:00 +03:00
Asia/Saigon +07:00 +07:00
Asia/Sakhalin MSK+08 - Sakhalin Island +11:00 +11:00
Asia/Samarkand Uzbekistan (west) +05:00 +05:00
Asia/Seoul +09:00 +09:00
Asia/Shanghai Beijing Time +08:00 +08:00
Asia/Singapore +08:00 +08:00
Asia/Srednekolymsk MSK+08 - Sakha (E); North Kuril Is +11:00 +11:00
Asia/Taipei +08:00 +08:00
Asia/Tashkent Uzbekistan (east) +05:00 +05:00
Asia/Tbilisi +04:00 +04:00
Asia/Tehran +03:30 +04:30
Asia/Tel_Aviv +02:00 +03:00
Asia/Thimbu +06:00 +06:00
Asia/Thimphu +06:00 +06:00
Asia/Tokyo +09:00 +09:00
Asia/Tomsk MSK+04 - Tomsk +07:00 +07:00
Asia/Ujung_Pandang +08:00 +08:00
Asia/Ulaanbaatar Mongolia (most areas) +08:00 +08:00
Asia/Ulan_Bator +08:00 +08:00
Asia/Urumqi Xinjiang Time +06:00 +06:00
Asia/Ust-Nera MSK+07 - Oymyakonsky +10:00 +10:00
Asia/Vientiane +07:00 +07:00
Asia/Vladivostok MSK+07 - Amur River +10:00 +10:00
Asia/Yakutsk MSK+06 - Lena River +09:00 +09:00
Asia/Yangon +06:30 +06:30
Asia/Yekaterinburg MSK+02 - Urals +05:00 +05:00
Asia/Yerevan +04:00 +04:00
Atlantic/Azores Azores -01:00 +00:00
Atlantic/Bermuda -04:00 -03:00
Atlantic/Canary Canary Islands +00:00 +01:00
Atlantic/Cape_Verde -01:00 -01:00
Atlantic/Faeroe +00:00 +01:00
Atlantic/Faroe +00:00 +01:00
Atlantic/Jan_Mayen +01:00 +02:00
Atlantic/Madeira Madeira Islands +00:00 +01:00
Atlantic/Reykjavik +00:00 +00:00
Atlantic/South_Georgia -02:00 -02:00
Atlantic/St_Helena +00:00 +00:00
Atlantic/Stanley -03:00 -03:00
Australia/ACT +10:00 +11:00
Australia/Adelaide South Australia +09:30 +10:30
Australia/Brisbane Queensland (most areas) +10:00 +10:00
Australia/Broken_Hill New South Wales (Yancowinna) +09:30 +10:30
Australia/Canberra +10:00 +11:00
Australia/Currie +10:00 +11:00
Australia/Darwin Northern Territory +09:30 +09:30
Australia/Eucla Western Australia (Eucla) +08:45 +08:45
Australia/Hobart Tasmania +10:00 +11:00
Australia/LHI +10:30 +11:00
Australia/Lindeman Queensland (Whitsunday Islands) +10:00 +10:00
Australia/Lord_Howe Lord Howe Island +10:30 +11:00
Australia/Melbourne Victoria +10:00 +11:00
Australia/North +09:30 +09:30
Australia/NSW +10:00 +11:00
Australia/Perth Western Australia (most areas) +08:00 +08:00
Australia/Queensland +10:00 +10:00
Australia/South +09:30 +10:30
Australia/Sydney New South Wales (most areas) +10:00 +11:00
Australia/Tasmania +10:00 +11:00
Australia/Victoria +10:00 +11:00
Australia/West +08:00 +08:00
Australia/Yancowinna +09:30 +10:30
Brazil/Acre -05:00 -05:00
Brazil/DeNoronha -02:00 -02:00
Brazil/East -03:00 -03:00
Brazil/West -04:00 -04:00
Canada/Atlantic -04:00 -03:00
Canada/Central -06:00 -05:00
Canada/Eastern -05:00 -04:00
Canada/Mountain -07:00 -06:00
Canada/Newfoundland -03:30 -02:30
Canada/Pacific -08:00 -07:00
Canada/Saskatchewan -06:00 -06:00
Canada/Yukon -07:00 -07:00
CET +01:00 +02:00
Chile/Continental -04:00 -03:00
Chile/EasterIsland -06:00 -05:00
CST6CDT -06:00 -05:00
Cuba -05:00 -04:00
EET +02:00 +03:00
Egypt +02:00 +02:00
Eire +01:00 +00:00
EST -05:00 -05:00
EST5EDT -05:00 -04:00
Etc/GMT +00:00 +00:00
Etc/GMT+0 +00:00 +00:00
Etc/GMT+1 -01:00 -01:00
Etc/GMT+10 -10:00 -10:00
Etc/GMT+11 -11:00 -11:00
Etc/GMT+12 -12:00 -12:00
Etc/GMT+2 -02:00 -02:00
Etc/GMT+3 -03:00 -03:00
Etc/GMT+4 -04:00 -04:00
Etc/GMT+5 -05:00 -05:00
Etc/GMT+6 -06:00 -06:00
Etc/GMT+7 -07:00 -07:00
Etc/GMT+8 -08:00 -08:00
Etc/GMT+9 -09:00 -09:00
Etc/GMT-0 +00:00 +00:00
Etc/GMT-1 +01:00 +01:00
Etc/GMT-10 +10:00 +10:00
Etc/GMT-11 +11:00 +11:00
Etc/GMT-12 +12:00 +12:00
Etc/GMT-13 +13:00 +13:00
Etc/GMT-14 +14:00 +14:00
Etc/GMT-2 +02:00 +02:00
Etc/GMT-3 +03:00 +03:00
Etc/GMT-4 +04:00 +04:00
Etc/GMT-5 +05:00 +05:00
Etc/GMT-6 +06:00 +06:00
Etc/GMT-7 +07:00 +07:00
Etc/GMT-8 +08:00 +08:00
Etc/GMT-9 +09:00 +09:00
Etc/GMT0 +00:00 +00:00
Etc/Greenwich +00:00 +00:00
Etc/UCT +00:00 +00:00
Etc/Universal +00:00 +00:00
Etc/UTC +00:00 +00:00
Etc/Zulu +00:00 +00:00
Europe/Amsterdam +01:00 +02:00
Europe/Andorra +01:00 +02:00
Europe/Astrakhan MSK+01 - Astrakhan +04:00 +04:00
Europe/Athens +02:00 +03:00
Europe/Belfast +00:00 +01:00
Europe/Belgrade +01:00 +02:00
Europe/Berlin Germany (most areas) +01:00 +02:00
Europe/Bratislava +01:00 +02:00
Europe/Brussels +01:00 +02:00
Europe/Bucharest +02:00 +03:00
Europe/Budapest +01:00 +02:00
Europe/Busingen Busingen +01:00 +02:00
Europe/Chisinau +02:00 +03:00
Europe/Copenhagen +01:00 +02:00
Europe/Dublin +01:00 +00:00
Europe/Gibraltar +01:00 +02:00
Europe/Guernsey +00:00 +01:00
Europe/Helsinki +02:00 +03:00
Europe/Isle_of_Man +00:00 +01:00
Europe/Istanbul +03:00 +03:00
Europe/Jersey +00:00 +01:00
Europe/Kaliningrad MSK-01 - Kaliningrad +02:00 +02:00
Europe/Kiev Ukraine (most areas) +02:00 +03:00
Europe/Kirov MSK+00 - Kirov +03:00 +03:00
Europe/Lisbon Portugal (mainland) +00:00 +01:00
Europe/Ljubljana +01:00 +02:00
Europe/London +00:00 +01:00
Europe/Luxembourg +01:00 +02:00
Europe/Madrid Spain (mainland) +01:00 +02:00
Europe/Malta +01:00 +02:00
Europe/Mariehamn +02:00 +03:00
Europe/Minsk +03:00 +03:00
Europe/Monaco +01:00 +02:00
Europe/Moscow MSK+00 - Moscow area +03:00 +03:00
Europe/Nicosia +02:00 +03:00
Europe/Oslo +01:00 +02:00
Europe/Paris +01:00 +02:00
Europe/Podgorica +01:00 +02:00
Europe/Prague +01:00 +02:00
Europe/Riga +02:00 +03:00
Europe/Rome +01:00 +02:00
Europe/Samara MSK+01 - Samara, Udmurtia +04:00 +04:00
Europe/San_Marino +01:00 +02:00
Europe/Sarajevo +01:00 +02:00
Europe/Saratov MSK+01 - Saratov +04:00 +04:00
Europe/Simferopol Crimea +03:00 +03:00
Europe/Skopje +01:00 +02:00
Europe/Sofia +02:00 +03:00
Europe/Stockholm +01:00 +02:00
Europe/Tallinn +02:00 +03:00
Europe/Tirane +01:00 +02:00
Europe/Tiraspol +02:00 +03:00
Europe/Ulyanovsk MSK+01 - Ulyanovsk +04:00 +04:00
Europe/Uzhgorod Transcarpathia +02:00 +03:00
Europe/Vaduz +01:00 +02:00
Europe/Vatican +01:00 +02:00
Europe/Vienna +01:00 +02:00
Europe/Vilnius +02:00 +03:00
Europe/Volgograd MSK+00 - Volgograd +03:00 +03:00
Europe/Warsaw +01:00 +02:00
Europe/Zagreb +01:00 +02:00
Europe/Zaporozhye Zaporozhye and east Lugansk +02:00 +03:00
Europe/Zurich Swiss time +01:00 +02:00
Factory +00:00 +00:00
GB +00:00 +01:00
GB-Eire +00:00 +01:00
GMT +00:00 +00:00
GMT+0 +00:00 +00:00
GMT-0 +00:00 +00:00
GMT0 +00:00 +00:00
Greenwich +00:00 +00:00
Hongkong +08:00 +08:00
HST -10:00 -10:00
Iceland +00:00 +00:00
Indian/Antananarivo +03:00 +03:00
Indian/Chagos +06:00 +06:00
Indian/Christmas +07:00 +07:00
Indian/Cocos +06:30 +06:30
Indian/Comoro +03:00 +03:00
Indian/Kerguelen Kerguelen, St Paul Island, Amsterdam Island +05:00 +05:00
Indian/Mahe +04:00 +04:00
Indian/Maldives +05:00 +05:00
Indian/Mauritius +04:00 +04:00
Indian/Mayotte +03:00 +03:00
Indian/Reunion Réunion, Crozet, Scattered Islands +04:00 +04:00
Iran +03:30 +04:30
Israel +02:00 +03:00
Jamaica -05:00 -05:00
Japan +09:00 +09:00
Kwajalein +12:00 +12:00
Libya +02:00 +02:00
MET +01:00 +02:00
Mexico/BajaNorte -08:00 -07:00
Mexico/BajaSur -07:00 -06:00
Mexico/General -06:00 -05:00
MST -07:00 -07:00
MST7MDT -07:00 -06:00
Navajo -07:00 -06:00
NZ +12:00 +13:00
NZ-CHAT +12:45 +13:45
Pacific/Apia +13:00 +14:00
Pacific/Auckland New Zealand time +12:00 +13:00
Pacific/Bougainville Bougainville +11:00 +11:00
Pacific/Chatham Chatham Islands +12:45 +13:45
Pacific/Chuuk Chuuk/Truk, Yap +10:00 +10:00
Pacific/Easter Easter Island -06:00 -05:00
Pacific/Efate +11:00 +11:00
Pacific/Enderbury Phoenix Islands +13:00 +13:00
Pacific/Fakaofo +13:00 +13:00
Pacific/Fiji +12:00 +13:00
Pacific/Funafuti +12:00 +12:00
Pacific/Galapagos Galápagos Islands -06:00 -06:00
Pacific/Gambier Gambier Islands -09:00 -09:00
Pacific/Guadalcanal +11:00 +11:00
Pacific/Guam +10:00 +10:00
Pacific/Honolulu Hawaii -10:00 -10:00
Pacific/Johnston -10:00 -10:00
Pacific/Kiritimati Line Islands +14:00 +14:00
Pacific/Kosrae Kosrae +11:00 +11:00
Pacific/Kwajalein Kwajalein +12:00 +12:00
Pacific/Majuro Marshall Islands (most areas) +12:00 +12:00
Pacific/Marquesas Marquesas Islands -09:30 -09:30
Pacific/Midway Midway Islands -11:00 -11:00
Pacific/Nauru +12:00 +12:00
Pacific/Niue -11:00 -11:00
Pacific/Norfolk +11:00 +12:00
Pacific/Noumea +11:00 +11:00
Pacific/Pago_Pago Samoa, Midway -11:00 -11:00
Pacific/Palau +09:00 +09:00
Pacific/Pitcairn -08:00 -08:00
Pacific/Pohnpei Pohnpei/Ponape +11:00 +11:00
Pacific/Ponape +11:00 +11:00
Pacific/Port_Moresby Papua New Guinea (most areas) +10:00 +10:00
Pacific/Rarotonga -10:00 -10:00
Pacific/Saipan +10:00 +10:00
Pacific/Samoa -11:00 -11:00
Pacific/Tahiti Society Islands -10:00 -10:00
Pacific/Tarawa Gilbert Islands +12:00 +12:00
Pacific/Tongatapu +13:00 +13:00
Pacific/Truk +10:00 +10:00
Pacific/Wake Wake Island +12:00 +12:00
Pacific/Wallis +12:00 +12:00
Pacific/Yap +10:00 +10:00
Poland +01:00 +02:00
Portugal +00:00 +01:00
PRC +08:00 +08:00
PST8PDT -08:00 -07:00
ROC +08:00 +08:00
ROK +09:00 +09:00
Singapore +08:00 +08:00
Turkey +03:00 +03:00
UCT +00:00 +00:00
Universal +00:00 +00:00
US/Alaska -09:00 -08:00
US/Aleutian -10:00 -09:00
US/Arizona -07:00 -07:00
US/Central -06:00 -05:00
US/East-Indiana -05:00 -04:00
US/Eastern -05:00 -04:00
US/Hawaii -10:00 -10:00
US/Indiana-Starke -06:00 -05:00
US/Michigan -05:00 -04:00
US/Mountain -07:00 -06:00
US/Pacific -08:00 -07:00
US/Samoa -11:00 -11:00
UTC +00:00 +00:00
W-SU +03:00 +03:00
WET +00:00 +01:00
Zulu +00:00 +00:00

Package Sidebar

Install

npm i util-tiempo

Weekly Downloads

5

Version

1.0.52

License

MIT

Unpacked Size

144 kB

Total Files

30

Last publish

Collaborators

  • tutitoos
  • xtomha96