423,849 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,849 IT Pros & Developers. It's quick & easy.

reading date of computer's visitor

P: 1
I have this codage for my horoscope page, now showing date of server not of computer visitor anyone can help me please????

Public Function DateToText(ParamDate)

dim Day_ParamDate
dim Mon_ParamDate
dim Month_ParamDate
dim Year_ParamDate

Day_ParamDate = CInt(Day(ParamDate))
Mon_ParamDate = CInt(Month(ParamDate))
Year_ParamDate = CInt(Year(ParamDate))
If Day_ParamDate < 10 Then
Day_ParamDate = "0" & CStr(Day_ParamDate)
End If
If Mon_ParamDate < 10 Then
Mon_ParamDate = "0" & CStr(Mon_ParamDate)
End If
DateToText = Day_ParamDate &"/"& Mon_ParamDate &"/"& Year_ParamDate

End Function
<%
dim horoDay
dim horoDay_str
dim horoMonth
dim horoYear
dim horodate
dim horolang
dim horosign
dim horodetails

'horodate = CStr(FormatDate(Request.QueryString("horodate"), "d-M-Y"))
horodate = CStr(Request.QueryString("horodate"))
horoDay = CInt(Left(horodate,2))
horoMonth = CInt(Mid(horodate,4,2))
horoYear = CInt(Right(horodate,4))
if horoDay < 10 then
horoDay_str = "0" & CStr(horoDay)
else
horoDay_str = CStr(horoDay)
end if
horodate = horoDay_str & "-" & left(UCASE(MonthName(horoMonth)),3) & "-" & CStr(horoYear)
horolang = CInt(Request.QueryString("horolang"))
horosign = CInt(Request.QueryString("horosign"))

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open session("mySessionDB")
Set rs = Server.CreateObject("ADODB.Recordset")

sqlQuery = "Select * From Horo Where Horo_Date = '" &horodate& "' And Horo_Lang = " &horolang& " And Horo_Sign = " &horosign
rs.Open sqlQuery, objConn, 1, 2
if not (rs.EOF And rs.BOF) then
horodetails = rs("Horo_Details")
else
horodetails = "N/A"
end if
rs.Close
%>
<a href="horo_sign.asp?horodate=<%=DateToText(now())% >&horolang=2&horosign=5">
this code must read date of computer visitor for now
Apr 28 '18 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 946
Almost always* the date on the computer of the visitor is the same as on your computer.

*) It should be accurate enough to display a horoscope....
Apr 28 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.