Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400

    Funzione conversione data

    Ho trovato questa funzione con la ricerca:
    codice:
    Function dataShort(dtData) 
        dataShort = year(dtData&"/"&right("00"&month(dtData),2)&"/"&right("00"&day(dtData),2)) 
    end Function 
    
    data = dataShort(CDate(date()))
    response.write data &"
    "
    Ma restituisce sempre:
    Microsoft VBScript runtime error '800a000d'

    Type mismatch: '[string: "10/09/2005/09/10"]'

    /defaultuse/NewLogin.asp, line 46
    Dove sbaglio???


  2. #2
    Ma cosa dovrebbe fare questa funzione?

  3. #3
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    Originariamente inviato da Mems
    Ma cosa dovrebbe fare questa funzione?
    trasformare la data nel formato aaaa/mm/gg

  4. #4
    concordo...ma che deve fare?

  5. #5
    codice:
    Function dataShort(dtData) 
      
    dataShort=year(dtData) & "/" & month(dtData) & "/" & day(dtData)
    
    end Function

  6. #6
    codice:
    <%
    function convertDate(theDate)
    if isDate(theDate) then
    theYear = datePart("yyyy",theDate)
    theMonth = datePart("m",theDate)
    theDay = datePart("d",theDate)
    if theMonth < 10 then theMonth = "0" & theMonth
    if theDay < 10 then theDay = "0" & theDay
    convertDate = theYear & "/" & theMonth & "/" & theDay
    end if
    end function
    
    myDate = date()
    response.write convertDate(myDate)
    %>

  7. #7
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400
    grazie !

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 © 2026 vBulletin Solutions, Inc. All rights reserved.