This code is for a comments section on a news article. Each comment shows the time. The page is an asp page.
I'd like to add 2 hours, hopefully within the code below to make the time show 2 hours ahead, i'd need to be able to adjust it for daylight saving in future.
This code:
shows the time like this
"4:34:20 AM"
Just to clarify the layout: The comments are added to the end of the article, by readers, and they open up in a separate small window from a link . Headlines of the comments show below the news article. Each headline shows the title, and date and time posted.
In other words, on the public side, i'd like the comments to show another time, 2 hours ahead. I don't mind if the database contains the orignal server time, since it won't show on the public sides.
Any tips anyone?
Thanks in advance
--------------------
I'd like to add 2 hours, hopefully within the code below to make the time show 2 hours ahead, i'd need to be able to adjust it for daylight saving in future.
This code:
Code:
<%=FormatDateTime(C_DATE,3)%>
"4:34:20 AM"
Just to clarify the layout: The comments are added to the end of the article, by readers, and they open up in a separate small window from a link . Headlines of the comments show below the news article. Each headline shows the title, and date and time posted.
In other words, on the public side, i'd like the comments to show another time, 2 hours ahead. I don't mind if the database contains the orignal server time, since it won't show on the public sides.
Any tips anyone?
Thanks in advance
--------------------
Code:
SQL = "SELECT ID, fldNAME, fldCOMMENT, fldDATE, fldSUBJECT, fldM_ID, fldCITY, fldCOUNTRY, fldALLOW, fldEMAIL FROM nm_tbl_comment WHERE fldNEWS_ID = " & NID & " ORDER BY ID ASC" Set RS = Server.CreateObject("ADODB.Recordset") RS.LockType = 1 RS.CursorType = 0 RS.Open SQL, MyConn WHILE NOT RS.EOF CCOUNT = CCOUNT + 1 C_ID = trim(RS("ID")) C_NAME = trim(RS("fldNAME")) C_COMMENT = trim(RS("fldCOMMENT")) C_SUBJECT = trim(RS("fldSUBJECT")) C_M_ID = trim(RS("fldM_ID")) C_DATE = trim(RS("fldDATE")) C_CITY = trim(RS("fldCITY")) C_COUNTRY = trim(RS("fldCOUNTRY")) C_ALLOW_E = trim(RS("fldALLOW")) C_EMAIL = trim(RS("fldEMAIL")) %> <td width="100%"><%IF Trim(C_ALLOW_E) = "1" THEN%><a class="linkComment" href="file/_mail.asp?ID=<%=C_ID%>&AID=<%=NID%>" onClick="NewWindow(this.href,'name','450','410','Yes');return false;"> <img src="blogs/img_ss.gif" width="14" height="9" alt="" border="0" /></a> <%END IF%> <span style="color: #4169E1; font-size: 10px"><%= C_NAME %> - <%=C_CITY%>-<%=C_COUNTRY%> - <%=FormatDateTime(C_DATE,2)%>-<%=FormatDateTime(C_DATE,3)%> </span></td>
Comment