Jump to content
Fórum Script Brasil
  • 0

Exibir Data


renanj

Question

Como faço para exibir a data no padrão brasileiro nessa pagina???

<%

'Abre a conexão com o banco de dados

Set Conex = Server.CreateObject ("ADODB.Connection")

Conex.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("database/dados.mdb")

'Lista o conteúdo do banco de dados

Set listar = Server.CreateObject("ADODB.Recordset")

sql = "Select * from mensagens"

listar.open sql, conex, 1,1

'Contamos quantos registros existem no banco

torpedos = listar.Recordcount

%>

<html>

<head>

<title>-_-_-_-_-_-_-&nbsp;&nbsp; LIVRO DE VISITAS&nbsp;&nbsp; -_-_-_-_-_-_-</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

a:link {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 11px;

color: #CCCCCC;

text-decoration: none;

}

a:visited {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 11px;

color: #CCCCCC;

text-decoration: none;

}

a:hover {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 11px;

color: #CCCCCC;

text-decoration: underline;

}

a:active {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 11px;

color: #CCCCCC;

text-decoration: none;

}

-->

</style>

</head>

<body bgcolor="#444466" id="index">

<script language="JavaScript">

function janela(popupfile,winheight,winwidth)

{

open(popupfile,"PopupWindow","resizable=no,height=" + winheight + ",width=" + winwidth + ",scrollbars=no");

}

</script>

<div align="left">

<table border="1" width="28%" id="table1" bordercolor="#444466" cellspacing="0" cellpadding="0" height="22">

<tr>

<td width="169" bordercolor="#FFFFFF">

<p align="center">

<a href="javascript:janela('nova_mensagem.asp',400,500)" onClick="">Escrever

Nova

mensagem</a></td>

<td bordercolor="#FFFFFF">

<p align="center"> <a onClick href="admin/index.asp">Administração</a></td>

</tr>

</table>

<p align="center">&nbsp;</p>

<br>

</div>

<p align="center">

<img border="0" src="imagens/Livro_de_visitasc.gif" width="250" height="35"></p>

<p align="center">

<br>

<%if listar.eof then%>

</p>

<div align="center">

<br>

<font color="#CCCCCC" size="2" face="Verdana, Arial, Helvetica, sans-serif">N&atilde;o

h&aacute; mensagens!</font></div>

<p align="center">

<br>

<%else%>

<p>&nbsp;</p>

<div align="center">

<table width="84%" border="0" cellspacing="0" cellpadding="0" style="border-left-style:solid; border-left-width:1px; border-right-style:solid; border-right-width:1ps; border-top-style:solid; border-top-width:1px; border-bottom-style:solid; border-bottom-width:1px" bordercolor="#444466">

<%listar.movelast%>

<%while not listar.bof%>

<tr bgcolor="#CCCCCC">

<td width="50%" height="23" valign="bottom"><strong><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<%=listar("nome")%></font></strong></td>

<td width="43%" valign="bottom">

<div align="right"><strong><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<%=listar("data")%>

- <%=listar("hora")%>&nbsp;&nbsp;</font></strong></div></td>

</tr> <tr bgcolor="#CCCCCC">

<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;</font></td>

<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;</font></td>

</tr>

<tr bgcolor="#CCCCCC">

<td height="22" colspan="2"> <table width="99%" height="99%" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="efefef" style="Border-top:#000000 1px solid;Border-bottom:#000000 1px solid;">

<tr>

<td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;<%=listar("mensagem")%></font></td>

</tr>

<tr>

<td><div align="right"><a href="mailto: <%=listar("email")%>">

<font size="1" face="Arial"><img src="imagens/email.gif" width="15" height="9" border="0"></font></a><font size="1" face="Arial">

</font>

<a href="#"><font size="1" face="Arial"><img src="imagens/icq.gif" width="15" height="16" border="0" onClick="javaScript:alert('ICQ: ' + <%=listar("icq")%>)"></font></a>

<a href="<%=listar("site")%>" target="_blank"><img src="imagens/site.gif" width="19" height="17" border="0"></font></a></div>

<div align="right"><font face="Arial" size="1">IP: <%=listar("ip")%></font></div></td>

</tr>

</table></td>

</tr>

<tr bgcolor="#CCCCCC">

<td colspan="2">&nbsp;</td>

</tr>

<tr bgcolor="#CCCCCC">

<td colspan="2" bgcolor="#444466"><div align="right"> &nbsp;</div></td>

</tr>

<%listar.moveprevious

wend

%>

</table>

</div>

<div align="center"><br>

<font color="#CCCCCC" size="1" face="Verdana, Arial, Helvetica, sans-serif">Estamos

com <%response.Write(torpedos)

if torpedos = 1 then response.Write(" torpedo.") else response.Write(" torpedos.") end if%> </font></div>

<p align="center"> <br>

<%end if%>

</p>

<div align="center">

<font color="#CCCCCC" size="1" face="Verdana, Arial, Helvetica, sans-serif">

--------------------------------------------------------- <br>

Os Tico - Tico Fuzilado</font></div>

</body>

</html>

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Simples!!!

Coloque no seu código ASP isso:

Session.LCID = 1046

Link to comment
Share on other sites

  • 0

hehe

é isso que o guto disse.. mas coloca isso ae no começo do codigo..

Link to comment
Share on other sites

  • 0

Você está listando a data e hora que está no banco de dados...

<%=listar("data")%> - <%=listar("hora")%&nbsp;&nbsp;</font></strong></div></td>

Mas quando você vai salva você usa a função, data(), e a função time():

Ou se você quisesse que aparecesse a data e hora de agora, você teria que mudar o codigo, ficando assim:

<%=date()%> - <%=time()%&nbsp;&nbsp;</font></strong></div></td>

Qualquer coisa posta ae, que nós estaremos aqui ajudando!!!! wink.gif

Abraços,

[]'s

Victor

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...