xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

UTC 时间转换 All In One

http://www.timebie.com/cn/stduniversal.php

UTC 时间

世界的每个地区都有自己的本地时间,在 Internet 及无线电通信时,时间的统一非常重要!

整个地球分为二十四时区,每个时区都有自己的本地时间。

在国际无线电通信中,为统一而普遍使用一个标准时间,称为通用协调时 (UTC, Universal Time Coordinated)。
UTC 与格林尼治平均时 (GMT, Greenwich Mean Time)一样,都与英国伦敦的本地时相同。
UTC 与 GMT 含义完全相同。

格林尼治时间 0

http://zh.thetimenow.com/utc/coordinated_universal_time

北京时间

+8

时间转换

00:08 => 09:03:55/ 09:04:32 / 09:01:06

23:00 => 07:09:31

23:59 => 08:00:00 ???

  schedule:
    - cron: '8 0 * * *'

  schedule:
    - cron: '0 23 * * *'

  schedule:
    - cron: '59 23 * * *'

温度单位转换

摄氏度 ℃ & 华氏 ℉

32 华氏温标 === 0 摄氏温标

转换公式 Formula

(32°F − 32) × 5/9 = 0°C

demo

bug

OK

weather.sh

#!/bin/sh

# ???
set -eux

# 设置 env
LANGUAGE="zh-CN"
CITY=Shanghai
UNIT=m
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4343.0 Safari/537.36"

# 文档见 wttr.in
curl 
  -H "Accept-Language: $LANGUAGE" 
  -H "User-Agent: $UA" 
  -o result.html 
  wttr.in/$CITY
  # wttr.in/$CITY?format=4&$UNIT

https://github.com/xgqfrms/weather-email-action/blob/main/weather.sh

/Users/xgqfrms-mbp/Documents/GitHub/gitHub-secrets-all-in-one/weather.sh

#!/bin/sh

# ???
set -eux

# 设置 env
LANGUAGE="zh-CN"
CITY=Shanghai
# m === °C
UNIT=m
# u === °F (default)
# UNIT=u
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4343.0 Safari/537.36"

# 文档见 wttr.in
curl 
  -H "Accept-Language: $LANGUAGE" 
  -H "User-Agent: $UA" 
  -o result.html 
  wttr.in/$CITY?$UNIT
  # wttr.in/$CITY
  # wttr.in/$CITY?format=4&$UNIT

# refs
# https://github.com/xgqfrms/weather-email-action/issues/3

refs

https://github.com/xgqfrms/weather-email-action/issues/3

https://github.com/chubin/wttr.in/issues/553



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


原文地址:https://www.cnblogs.com/xgqfrms/p/14097254.html