๋ฐ˜์‘ํ˜•

Time zone 1

[JavaScript] ํƒ€์ž„์กด time zone offset ๊ตฌํ•˜๋Š” ๋ฐฉ๋ฒ•

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” JavaScript๋กœ ํƒ€์ž„์กด time zone offset์„ ๊ตฌํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๊ธฐ์— ์•ž์„œ ์šฐ์„  ํƒ€์ž„์กด ๊ฐœ๋…์„ ์ž ๊น ํ›‘์–ด๋ณด๊ณ  ์ง„ํ–‰ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. What is a time zone? ํƒ€์ž„์กด(time zone)์€ ๋™์ผํ•œ ๋กœ์ปฌ ์‹œ๊ฐ„์„ ๋”ฐ๋ฅด๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๋ฉฐ, ํ†ต์ƒ์ ์œผ๋กœ ๊ตญ๊ฐ€๋ณ„ ๊ณ ์œ ํ•œ ํƒ€์ž„์กด์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. Offset? ์˜คํ”„์…‹์€ UTC์™€์˜ ์ฐจ์ด๋ฅผ ๋‚˜ํƒ€๋‚ธ ๊ฒƒ์„ ๋งํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ์‹œ๋กœ UTC+09:00 ์—์„œ +9:00๋Š” UTC์˜ ๊ธฐ์ค€์‹œ๊ฐ„๋ณด๋‹ค 9์‹œ๊ฐ„์ด ๋น ๋ฅด๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ํƒ€์ž„์กด์€ KST (Korea Standard Time) ์ด๋ผ๊ณ  ๋ถˆ๋ฆฌ๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. How to get a offset? ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ํ™œ์šฉํ•˜์—ฌ offset์„ ๊ตฌํ•  ์ˆ˜ ์žˆ์Šต..

๋ฐ˜์‘ํ˜•