Blockdit Logo
Blockdit Logo (Mobile)
สำรวจ
ลงทุน
คำถาม
เข้าสู่ระบบ
มีบัญชีอยู่แล้ว?
เข้าสู่ระบบ
หรือ
ลงทะเบียน
IoT ตามใจเราเอง
•
ติดตาม
29 เม.ย. 2021 เวลา 01:54 • วิทยาศาสตร์ & เทคโนโลยี
Node-Red วิธีการดึงเวลานั้นมีแบบไหนบาง
ตัวอย่างแรก
const now = new Date();
Output
Wed Oct 18 2017 12:41:34 GMT+0000 (UTC)
Ref:
https://www.digitalocean.com/community/tutorials/understanding-date-and-time-in-javascript
ตัวอย่างถัดไป
new Date().toLocaleString();
Output
'12/09/2016, 18:14:37'
Ref:
https://github.com/nodejs/node/issues/8500
Set TimeZone
new Date().toLocaleString('en-GB'); หรือ
new Date().toLocaleString('th-TH');
Ref:
https://www.w3schools.com/jsref/jsref_tolocalestring.asp
บันทึก
โฆษณา
ดาวน์โหลดแอปพลิเคชัน
© 2025 Blockdit
เกี่ยวกับ
ช่วยเหลือ
คำถามที่พบบ่อย
นโยบายการโฆษณาและบูสต์โพสต์
นโยบายความเป็นส่วนตัว
แนวทางการใช้แบรนด์ Blockdit
Blockdit เพื่อธุรกิจ
ไทย