web 2.0

ASP/VBScript DateThai()

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

ASP/VBScript & DateThai()

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.