Získanie dátum s aktuálne časové pásmo

Príklady kódu

0
0

datetime teraz s časových pásiem

from pytz import timezone
from datetime import datetime

UTC = timezone('Asia/Kolkata')

def time_now():
    return datetime.now(UTC)
    
print(time_now())
0
0

získajte dátum špecifické časové pásmo

function getTimeFromTimezone(offset) {  
  const currentDate = new Date() //get current time to calculate the UTC time
  let utc = currentDate.getTime() + (currentDate.getTimezoneOffset() * 60000) //calculates the UTC time
  let nd = new Date(utc + (3600000*offset)) // get the current timezone with the offset
  return nd
}

getTimeFromTimezone('+5.5').toLocaleString()
getTimeFromTimezone('-3').toLocaleString()

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................