ThaiPBL.com

PowerBuilder Library Thailand

อีเมล พิมพ์ PDF

System date format

ถ้าเราอยากทราบว่าขณะนี้รูปแบบวันที่ในระบบของเราเป็นรูปแบบใดเราสามารถเรียกฟังก์ชั่นด้านล่างนี้ขึ้นมาเพื่อดูและแก้ไข รูปแบบวันที่ได้ ซึ่งสามารถทำได้ทั้ง รูปแบบวันที่แบบย่อ กับ แบบเต็ม

Date ls_shortdate

RegistryGet("HKEY_CURRENT_USER\Control Panel\International","sShortDate",ls_shortdate)



และเมื่อเราต้องการเปลี่ยนรูปแบบไปตามที่เราต้องการก็ทำได้โดยตรงดังนี้

RegistrySet("HKEY_CURRENT_USER\Control Panel\International","sShortDate","dd/mm/yyyy")

หรือ

Sting ls_format

ls_format = "dd/mm/yyyy"



RegistrySet("HKEY_CURRENT_USER\Control Panel\International","sShortDate",ls_format)



ถ้าต้องการแก้ไขรูปแบบวันที่ แบบยาว ก็ แก้คำว่า sShortDate เป็น sLongdate เท่านี้ก็เรียบร้อย