Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    63

    Convertire data USA in EU

    Ciao a tutti/e,

    chi mi sa dire pf cosa devo aggiungere a questo codice per far sì che la mia data presa dal database access in questo formato yyyy/mm/gg (formato americano) venga restituita e trasformata i questo formato gg.mm.yyyy (formato europeo)??? Grazie mille per l'aiuto

    <%
    rs.Open "SELECT * FROM tbComunicati ORDER BY tbComunicati.Data DESC", cn, 1
    If rs.EOF Then
    %>


    Nessun record trovato!</p>
    <%
    Else
    While rs.EOF = False
    %>



    <%=rs("Data")%>
    <%=rs("Titolo")%>[b]
    <%=rs("Link")%></p>

    <%
    rs.MoveNext
    Wend
    End If
    rs.Close
    %>
    Olly

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    All'inizio dello script metti:

    session.LCID = 1040

    Roby

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    63
    Ciao Roby,

    all'inizio dove? Me lo metti tu? ecco tutta la paigna...

    <%@LANGUAGE = VBScript%>
    <%
    Dim sc, cn, rs
    sc = "driver={Microsoft Access Driver (*.mdb)};dbq="
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open sc & Server.MapPath("db/news.mdb")
    Set rs = Server.CreateObject("ADODB.Recordset")
    %>
    <html>
    <head>
    <title>Comunicati</title>
    <LINK href="css/styles.css" type=text/css rel=stylesheet>
    </head>
    <body>

    <h1>[img]img/Logo_CCIATI_new.gif[/img]</h1>
    <h1>archivio Comunicati</h1>

    <%
    rs.Open "SELECT * FROM tbComunicati ORDER BY tbComunicati.Data DESC", cn, 1
    If rs.EOF Then
    %>


    Nessun record trovato!</p>
    <%
    Else
    While rs.EOF = False
    %>



    <%=rs("Data")%>
    <%=rs("Titolo")%>[b]
    <%=rs("Link")%></p>

    <%
    rs.MoveNext
    Wend
    End If
    rs.Close
    %>

    </body>
    </html>
    <%
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
    %>
    Olly

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Dopo

    @LANGUAGE = VBScript

    Roby

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    63
    Così?

    <%@LANGUAGE = VBScript
    %>
    <%
    session.LCID = 1040
    %>

    NON FUNZIONA...fai prima a metterlo tu le nel codice che ti ho mandato....grazie mille

    PS Ma sei sicuro che basta questo per fare cambiare il formato della data???
    Olly

  6. #6
    fattela a mano, così te la fai come ti pare

    tieni presente che

    Day(rs("Data")) ti restituisce il giorno
    Month(rs("Data")) il mese
    Year(rs("Data")) l'anno


  7. #7
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    63
    Premetto che io ne so ben poco di codici asp...me lo fate sto piccolissimo favore...non chiedo molto ad esperti come voi....solo di mettermi il codice giusto...qui sotto vi metto il codice e mi mettete voi la parte giusta così che mi ridia la data nel formato dd/mm/yyyy vi ricordo che dal database arriva in questo formato yyyy/mm/dd....grazie mille

    <%@LANGUAGE = VBScript%>
    <%
    Dim sc, cn, rs
    sc = "driver={Microsoft Access Driver (*.mdb)};dbq="
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open sc & Server.MapPath("db/news.mdb")
    Set rs = Server.CreateObject("ADODB.Recordset")
    %>
    <html>
    <head>
    <title>Comunicati</title>
    <LINK href="css/styles.css" type=text/css rel=stylesheet>
    </head>
    <body>

    <h1>[img]img/Logo_CCIATI_new.gif[/img]</h1>
    <h1>archivio Comunicati</h1>

    <%
    rs.Open "SELECT * FROM tbComunicati ORDER BY tbComunicati.Data DESC", cn, 1
    If rs.EOF Then
    %>


    Nessun record trovato!</p>
    <%
    Else
    While rs.EOF = False
    %>



    <%=rs("Data")%>
    <%=rs("Titolo")%>[b]
    <%=rs("Link")%></p>

    <%
    rs.MoveNext
    Wend
    End If
    rs.Close
    %>

    </body>
    </html>
    <%
    Set rs = Nothing
    cn.Close
    Set cn = Nothing
    %>
    Olly

  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    <%
    gg = Day(rs("Data"))
    mm = Month(rs("Data"))
    yy = Year(rs("Data"))
    %>
    
    
    <%=gg &"/"& mm &"/"& yy%>
    <%=rs("Titolo")%>[b]
    <%=rs("Link")%></p>
    Roby

  9. #9
    Utente di HTML.it
    Registrato dal
    May 2001
    Messaggi
    63
    Così mi piaci Roby....chiaro e conciso...e più di tutto funziona! ;-)

    grazie mille e buon week-end
    Olly

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.