تاريخ شمسي سايت

amirlol

Well-Known Member
چرا از توابع فارسی شده استفاده نمی کنی !!!!
تابعو چک می کنم اگه شد هجریش می کنم
 

abcdefghi

New Member
سلام.... من مي خوان تاريخ سايت و شمسي كنم...... اينم كدش به زحمت اگه مي شه درستش كنيد ممنون....

function ChkDateTime(fDateTime)
if fDateTime = "" then
exit function
end if
if IsDate(fDateTime) then
select case strDateType
case "dmy"
ChkDateTime = Mid(fDateTime,7,2) & "/" & _
Mid(fDateTime,5,2) & "/" & _
Mid(fDateTime,1,4)
case "mdy"
ChkDateTime = Mid(fDateTime,5,2) & "/" & _
Mid(fDateTime,7,2) & "/" & _
Mid(fDateTime,1,4)
case "ymd"
ChkDateTime = Mid(fDateTime,1,4) & "/" & _
Mid(fDateTime,5,2) & "/" & _
Mid(fDateTime,7,2)
case "ydm"
ChkDateTime =Mid(fDateTime,1,4) & "/" & _
Mid(fDateTime,7,2) & "/" & _
Mid(fDateTime,5,2)
case "dmmy"
ChkDateTime = Mid(fDateTime,7,2) & " " & _
Monthname(Mid(fDateTime,5,2),1) & " " & _
Mid(fDateTime,1,4)
case "mmdy"
ChkDateTime = Monthname(Mid(fDateTime,5,2),1) & " " & _
Mid(fDateTime,7,2) & " " & _
Mid(fDateTime,1,4)
case "ymmd"
ChkDateTime = Mid(fDateTime,1,4) & " " & _
Monthname(Mid(fDateTime,5,2),1) & " " & _
Mid(fDateTime,7,2)
case "ydmm"
ChkDateTime = Mid(fDateTime,1,4) & " " & _
Mid(fDateTime,7,2) & " " & _
Monthname(Mid(fDateTime,5,2),1)
case "dmmmy"
ChkDateTime = Mid(fDateTime,7,2) & " " & _
Monthname(Mid(fDateTime,5,2),0) & " " & _
Mid(fDateTime,1,4)
case "mmmdy"
ChkDateTime = Monthname(Mid(fDateTime,5,2),0) & " " & _
Mid(fDateTime,7,2) & " " & _
Mid(fDateTime,1,4)
case "ymmmd"
ChkDateTime = Mid(fDateTime,1,4) & " " & _
Monthname(Mid(fDateTime,5,2),0) & " " & _
Mid(fDateTime,7,2)
case "ydmmm"
ChkDateTime = Mid(fDateTime,1,4) & " " & _
Mid(fDateTime,7,2) & " " & _
Monthname(Mid(fDateTime,5,2),0)
case else
ChkDateTime = doublenum(Mid(fDateTime,5,2)) & "/" & _
Mid(fDateTime,7,2) & "/" & _
Mid(fDateTime,1,4)
end select
if strTimeType = 12 then
if cint(Mid(fDateTime, 9,2)) > 12 then
ChkDateTime = ChkDateTime & " " & _
(cint(Mid(fDateTime, 9,2)) -12) & ":" & _
Mid(fDateTime, 11,2) & ":" & _
Mid(fDateTime, 13,2) & " " & "PM"
elseif cint(Mid(fDateTime, 9,2)) = 12 then
ChkDateTime = ChkDateTime & " " & _
cint(Mid(fDateTime, 9,2)) & ":" & _
Mid(fDateTime, 11,2) & ":" & _
Mid(fDateTime, 13,2) & " " & "PM"
elseif cint(Mid(fDateTime, 9,2)) = 0 then
ChkDateTime = ChkDateTime & " " & _
(cint(Mid(fDateTime, 9,2)) +12) & ":" & _
Mid(fDateTime, 11,2) & ":" & _
Mid(fDateTime, 13,2) & " " & "AM"
else
ChkDateTime = ChkDateTime & " " & _
Mid(fDateTime, 9,2) & ":" & _
Mid(fDateTime, 11,2) & ":" & _
Mid(fDateTime, 13,2) & " " & "AM"
end if
else
ChkDateTime = ChkDateTime & " " & _
Mid(fDateTime, 9,2) & ":" & _
Mid(fDateTime, 11,2) & ":" & _
Mid(fDateTime, 13,2)
end if
end if
end function

function ChkDateFormat(strDateTime)
ChkDateFormat = isdate("" & Mid(strDateTime, 5,2) & "/" & Mid(strDateTime, 7,2) & "/" & Mid(strDateTime, 1,4) & " " & Mid(strDateTime, 9,2) & ":" & Mid(strDateTime, 11,2) & ":" & Mid(strDateTime, 13,2) & "")
end function

function StrToDate(strDateTime)
if ChkDateFormat(strDateTime) then
StrToDate = cdate("" & Mid(strDateTime, 5,2) & "/" & Mid(strDateTime, 7,2) & "/" & Mid(strDateTime, 1,4) & " " & Mid(strDateTime, 9,2) & ":" & Mid(strDateTime, 11,2) & ":" & Mid(strDateTime, 13,2) & "")
else
StrToDate = "" & strForumTimeAdjust
end if
end function

function DateToStr(dtDateTime)
DateToStr = year(dtDateTime) & doublenum(Month(dtdateTime)) & doublenum(Day(dtdateTime)) & doublenum(Hour(dtdateTime)) & doublenum(Minute(dtdateTime)) & doublenum(Second(dtdateTime)) & ""
end function

function ReadLastHereDate(UserName)
dim TempLastHereDate
dim rs_date

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_LASTHEREDATE "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS."&Strdbntsqlname&" = '" & UserName & "' "


set rs_date = my_conn.Execute (strSql)

if (rs_date.BOF and rs_date.EOF) then
TempLastHereDate = DateAdd("d",-10,strForumTimeAdjust)
else
TempLastHereDate = StrToDate(rs_date("M_LASTHEREDATE"))
if TempLastHereDate = "" or IsNull(TempLastHereDate) then
TempLastHereDate = DateAdd("d",-10,strForumTimeAdjust)
end if
end if

rs_date.close
set rs_date = nothing
 

abcdefghi

New Member
سلام....

آقا امير اگه مي شه واضح تر توضيح بديد..... منظورتون چيه.... اگه بشه كمك كنيد برا منم سوال شده
 

amirlol

Well-Known Member
اولآ که این کد رو از کجا آوردی از ASP - RIDER?



<!--Start Date HE ------------------------------------------------------------------------------------>
<script language="VBScript" id="clientEventHandlersVBS"><!--
Dim mmm
Dim yea
Dim mon
Dim da
Dim x1
Dim x2
Dim x3
Dim x4
Dim y1
Dim y2
Dim y3
Dim y4
Dim mah
Dim rooz
Dim sal, rrr, ah

mmm = Date
yea = Year(Date)
mon = Month(Date)
da = Day(Date)

X1 = (YEA/4)
X2 = (YEA - 1) / 4
X3 = (YEA - 2) / 4
X4 = (YEA - 3) / 4

Y1 = InStr(1, X1, ".")
Y2 = InStr(1, X2, ".")
Y3 = InStr(1, X3, ".")
Y4 = InStr(1, X4, ".")

If Y1 = 0 Then
If mon = 01 Then
If (da < 21) Then
Mah = "دي"
Rooz = da + 10
Sal = yea - 622
ElseIf (da => 21) Then
Mah = "بهمن"
Rooz = da - 20
Sal = yea - 622
End If
ElseIf mon = 02 Then
If (da < 20) Then
Mah = "بهمن"
Rooz = da + 11
Sal = yea - 622
ElseIf (da => 20) Then
Mah = "اسفند"
Rooz = da - 19
Sal = yea - 622
End If
ElseIf mon = 03 Then
If (da < 20) Then
Mah = "اسفند"
Rooz = da + 10
Sal = yea - 622
ElseIf (da => 20) Then
Mah = "فروردين"
Rooz = da - 19
Sal = yea - 621
End If
ElseIf mon = 04 Then
If (da < 20) Then
Mah = "فروردين"
Rooz = da + 12
Sal = yea - 621
ElseIf (da => 20) Then
Mah = "ارديبهشت"
Rooz = da - 19
Sal = yea - 621
End If
ElseIf mon = 05 Then
If (da < 21) Then
Mah = "ارديبهشت"
Rooz = da + 11
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "خرداد"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 06 Then
If (da < 21) Then
Mah = "خرداد"
Rooz = da + 11
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "تير"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 07 Then
If (da < 22) Then
Mah = "تير"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "مرداد"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 08 Then
If (da < 22) Then
Mah = "مرداد"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "شهريور"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 09 Then
If (da < 22) Then
Mah = "شهريور"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "مهر"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 10 Then
If (da < 22) Then
Mah = "مهر"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "آبان"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 11 Then
If (da < 21) Then
Mah = "آبان"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "آذر"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 12 Then
If (da < 21) Then
Mah = "آذر"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "دي"
Rooz = da - 20
Sal = yea - 621
End If
End If
ElseIf Y2 = 0 Then
If mon = 01 Then
If (da < 20) Then
Mah = "دي"
Rooz = da + 11
Sal = yea - 622
ElseIf (da => 20) Then
Mah = "بهمن"
Rooz = da - 19
Sal = yea - 622
End If
ElseIf mon = 02 Then
If (da < 19) Then
Mah = "بهمن"
Rooz = da + 12
Sal = yea - 622
ElseIf (da => 19) Then
Mah = "اسفند"
Rooz = da - 18
Sal = yea - 622
End If
ElseIf mon = 03 Then
If (da < 21) Then
Mah = "اسفند"
Rooz = da + 10
Sal = yea - 622
ElseIf (da => 21) Then
Mah = "فروردين"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 04 Then
If (da < 21) Then
Mah = "فروردين"
Rooz = da + 11
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "ارديبهشت"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 05 Then
If (da < 22) Then
Mah = "ارديبهشت"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "خرداد"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 06 Then
If (da < 22) Then
Mah = "خرداد"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "تير"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 07 Then
If (da < 23) Then
Mah = "تير"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "مرداد"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 08 Then
If (da < 23) Then
Mah = "مرداد"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "شهريور"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 09 Then
If (da < 23) Then
Mah = "شهريور"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "مهر"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 10 Then
If (da < 23) Then
Mah = "مهر"
Rooz = da + 8
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "آبان"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 11 Then
If (da < 22) Then
Mah = "آبان"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "آذر"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 12 Then
If (da < 22) Then
Mah = "آذر"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "دي"
Rooz = da - 21
Sal = yea - 621
End If
End If
ElseIf (Y3 = 0) Or (Y4 = 0) Then
If mon = 01 Then
If (da < 21) Then
Mah = "دي"
Rooz = da + 10
Sal = yea - 622
ElseIf (da => 21) Then
Mah = "بهمن"
Rooz = da - 20
Sal = yea - 622
End If
ElseIf mon = 02 Then
If (da < 20) Then
Mah = "بهمن"
Rooz = da + 11
Sal = yea - 622
ElseIf (da => 20) Then
Mah = "اسفند"
Rooz = da - 19
Sal = yea - 622
End If
ElseIf mon = 03 Then
If (da < 21) Then
Mah = "اسفند"
Rooz = da + 9
Sal = yea - 622
ElseIf (da => 21) Then
Mah = "فروردين"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 04 Then
If (da < 21) Then
Mah = "فروردين"
Rooz = da + 11
Sal = yea - 621
ElseIf (da => 21) Then
Mah = "ارديبهشت"
Rooz = da - 20
Sal = yea - 621
End If
ElseIf mon = 05 Then
If (da < 22) Then
Mah = "ارديبهشت"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "خرداد"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 06 Then
If (da < 22) Then
Mah = "خرداد"
Rooz = da + 10
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "تير"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 07 Then
If (da < 23) Then
Mah = "تير"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "مرداد"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 08 Then
If (da < 23) Then
Mah = "مرداد"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "شهريور"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 09 Then
If (da < 23) Then
Mah = "شهريور"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "مهر"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 10 Then
If (da < 23) Then
Mah = "مهر"
Rooz = da + 8
Sal = yea - 621
ElseIf (da => 23) Then
Mah = "آبان"
Rooz = da - 22
Sal = yea - 621
End If
ElseIf mon = 11 Then
If (da < 22) Then
Mah = "آبان"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "آذر"
Rooz = da - 21
Sal = yea - 621
End If
ElseIf mon = 12 Then
If (da < 22) Then
Mah = "آذر"
Rooz = da + 9
Sal = yea - 621
ElseIf (da => 22) Then
Mah = "دي"
Rooz = da - 21
Sal = yea - 621
End If
End If
End If
rrr = DatePart("w", now)

if (rrr = 1) Then
ah = "يكشنبه‏"
elseif (rrr = 2) Then
ah = "دوشنبه"
elseif (rrr = 3) Then
ah = "سه شنبه"
elseif (rrr = 4) Then
ah = "چهارشنبه‌"
elseif (rrr = 5) Then
ah = "پنج شنبه "
elseif (rrr = 6) Then
ah = "جمعه"
elseif (rrr = 7) Then
ah = "شنبه"
End If

--></script>

<!--Start Date HE ------------------------------------------------------------------------------------>



<script language="VBScript" id="clientEventHandlersVBS"><!--document.write (ah)
document.write (ah)
document.write (" ")
document.write (rooz)
document.write (" ")
document.write (mah)
document.write (" ")
document.write (sal)
--></script>
 

abcdefghi

New Member
salam na baba asprider chie..... in male site khodame ke ro localhoste mikham kamkam ye site bezanam ... in site ro ham kharidam az yeki.... asp hastesh montaha mikham shamsish konam hamin
 

amirlol

Well-Known Member
بدنبال همین موضوع ها در همین قسمت سایت باشید
چند موردی است

داتوم عزیز اون سایت هم قدیمی شده نمی دونم چرا هرکی می رسه اون آدرس رو می ده
 

جدیدترین ارسال ها

بالا