http://www.timeanddate.com/worldclock/converter.html 에 대해 알고 있습니다 .
"PST의 오후 5시 BST"와 같은 정상적인 형식으로 http://www.google.com 을 쿼리하는 방법을 알 수 없습니다 .
아니면 그런 앱을 작성해야합니까?
dateconv 2017-05-16T17:00 --from-zone iata:SFO --zone iata:LHR->2017-05-17T01:00:00
http://www.timeanddate.com/worldclock/converter.html 에 대해 알고 있습니다 .
"PST의 오후 5시 BST"와 같은 정상적인 형식으로 http://www.google.com 을 쿼리하는 방법을 알 수 없습니다 .
아니면 그런 앱을 작성해야합니까?
dateconv 2017-05-16T17:00 --from-zone iata:SFO --zone iata:LHR->2017-05-17T01:00:00
답변:
타이페이에서 오후 6시입니다. 몇시입니까?
date --date='TZ="Asia/Taipei" 18:00'
Fri Jul 16 11:00:00 BST 2010
여기 런던에서 오전 11시에 타이페이에서 몇시입니까?
TZ=Asia/Taipei date -d "11:00 BST"
Fri Jul 16 18:00:00 CST 2010
TZ=Europe/Moscow date --date='TZ="Asia/Taipei" 18:00' Mon Mar 27 18:00:00 CST 2017즉, 해당 시점의 현지 날짜가 아니라 타이페이의 날짜 만 알려줍니다. 맨 페이지에서는 방법이 정확하다고 말합니다. 내가 뭔가를 놓치고 있습니까? .. coreutils 8.26, 아치 리눅스
timedatectl list-timezones|grep -i taipei(prints Asia/Taipei), timedatectl list-timezones|grep -i berlin(prints Europe/Berlin), timedatectl list-timezones|grep -i angeles(prints America/Los_Angeles)
이 예제는 http://www.pixelbeat.org/cmdline.html#dates 에서 가져온 것입니다 .
미국 서해안의 오전 9시에 해당하는 현지 시간을 제공하여 일별 일광 절약 전환이 달라집니다.
date --date='TZ="America/Los_Angeles" 09:00 next Fri'
tzselect를 사용하여 TZ를 가져 오십시오. PST 형식이 모호합니다. IST = 인도 표준시 및 아일랜드 서머 타임.
tzselect. 감사합니다. 잘못된 'TZ'입력을 입력하면 잘못된 결과를 얻을 수 있습니다. 예 : TZ = 런던 날짜 Fri Jul 16 10:28:52 London 2010
나는 이것이 OP가 요구 한 것에 더 가깝다고 생각한다 (BST가 타이페이라는 것을 반드시 알지 못하기 때문에 대답은 'BST'에서 "Asia / Taipei"에 도착하는 방법을 설명하지 않는다).
먼저 내 현재 날짜 :
$ date
Mon Apr 21 13:07:21 MDT 2014
그런 다음 알고 싶은 날짜 :
$ date -d '5pm BST'
Mon Apr 21 15:00:00 MDT 2014
그래서 나는 그것을 알고 5pm BST 2시간 거리에 있습니다.
나는 보통 EDT 시간에서 두 시간을 추가하거나 제거 해야하는지 잊어 버리므로 작업 해야하는 일반적인 시간대가있는 작은 스크립트가 있습니다.
$ cat tz
#!/bin/bash
TZ='America/Edmonton' date
TZ='America/Chicago' date
TZ='America/New_York' date
그리고 출력 :
$ tz
Mon Apr 21 13:12:32 MDT 2014
Mon Apr 21 14:12:32 CDT 2014
Mon Apr 21 15:12:32 EDT 2014
tz스크립트의 올바른 위치는 여기에서 찾을 수 있습니다/usr/share/zoneinfo .
그러나 다시, 미래에 나는 단지을 사용한다 date -d '<time> <timezone>'.
Wolfram Alpha를 사용하십시오 . 기본 URL로…
http://www.wolframalpha.com/input/?i=
공백으로 대체하여 변환을 추가하십시오 +. 예를 들면 다음과 같습니다.
http://www.wolframalpha.com/input/?i=5+PM+CET+to+PST
Wolfram Alpha는 BST시간대 로 인식되지 않는 것 같습니다 .
나는 그것이 오래된 스레드라는 것을 알고 있지만, 동일한 사용 사례에 대한 코드가 필요했고 여기의 아이디어를 기반 으로이 작은 bash 스크립트를 개발했습니다.
#!/bin/bash
# ig20180122 - displays meeting options in other time zones
# set the following variable to the start and end of your working day
myday="8 20" # start and end time, with one space
# set the local TZ
myplace='America/Sao_Paulo'
# set the most common places
place[1]='America/Toronto'
place[2]='America/Chicago' # Houston as well
place[3]='Europe/Amsterdam'
place[4]='Europe/Dublin'
# add cities using place[5], etc.
# set the date format for search
dfmt="%m-%d" # date format for meeting date
hfmt="+%B %e, %Y" # date format for the header
# no need to change onwards
format1="%-10s " # Increase if your cities are large
format2="%02d "
mdate=$1
if [[ "$1" == "" ]]; then mdate=`date "+$dfmt"`; fi
date -j -f "$dfmt" "$hfmt" "$mdate"
here=`TZ=$myplace date -j -f "$dfmt" +%z "$mdate"`
here=$((`printf "%g" $here` / 100))
printf "$format1" "Here"
printf "$format2" `seq $myday`
printf "\n"
for i in `seq 1 "${#place[*]}"`
do
there=`TZ=${place[$i]} date -j -f "$dfmt" +%z "$mdate"`
there=$((`printf "%g" $there` / 100))
city[$i]=${place[$i]/*\//}
tdiff[$i]=$(($there - $here))
printf "$format1" ${city[$i]}
for j in `seq $myday`
do
printf "$format2" $(($j+${tdiff[$i]}))
done
printf "(%+d)\n" ${tdiff[$i]}
done
오늘 또는 미래의 시차를 확인하는 데 사용할 수 있습니다.
16:08 $ meet
January 22, 2019
Here 08 09 10 11 12 13 14 15 16 17 18 19 20
Toronto 05 06 07 08 09 10 11 12 13 14 15 16 17 (-3)
Chicago 04 05 06 07 08 09 10 11 12 13 14 15 16 (-4)
Amsterdam 11 12 13 14 15 16 17 18 19 20 21 22 23 (+3)
Dublin 10 11 12 13 14 15 16 17 18 19 20 21 22 (+2)
16:13 $ meet 05-24
May 24, 2019
Here 08 09 10 11 12 13 14 15 16 17 18 19 20
Toronto 07 08 09 10 11 12 13 14 15 16 17 18 19 (-1)
Chicago 06 07 08 09 10 11 12 13 14 15 16 17 18 (-2)
Amsterdam 13 14 15 16 17 18 19 20 21 22 23 24 25 (+5)
Dublin 12 13 14 15 16 17 18 19 20 21 22 23 24 (+4)
16:13 $
HTH