JavaScript UTC+09:00

1 개요[ | ]

JavaScript UTC+09
00
const offset = new Date().getTimezoneOffset();
const sign = (offset > 0)?'-':'+';
const hours = ('0'+Math.abs(offset) / 60).slice(-3);
const minutes = ('0'+Math.abs(offset) % 60).slice(-3);
const offsetString = `UTC${sign}${hours}:${minutes}`;
console.log(offsetString); // UTC+09:00

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}