ASP/VBScript DateThai() This function for asp script convert date to Thai Date
ShotDev Focus:
- Using Asp and DateThai()
Example
asp_datethai.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Function DateThai(strDate) Setlocale("en-us") Dim strDay,strMonth,strYear,strHour,strMinute,strSecond Dim arrMonth strDay = Day(strDate) strMonth = Month(strDate) strYear = Year(strDate) strHour = Hour(strDate) strMinute = Minute(strDate) strSecond = Second(strDate) arrMonth = Array("ม.ค","ก.พ","มี.ค","เม.ษ","พ.ค","มิ.ย","ก.ค","ส.ค","ก.ย","ต.ค","พ.ย","ธ.ค") DateThai = strDay &" "&arrMonth(strMonth-1) &" "&strYear &" "&strHour &":"&strMinute &":"&strSecond End Function Response.write DateThai("09/09/2010 15:16:17") %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_datethai.asp
Screenshot