Visualizzazione dei risultati da 1 a 3 su 3

Discussione: codifica data

  1. #1

    codifica data

    regazzi mi trovo di fronte ad ua questione importante:

    ho un db SqlServer con dei campi data in f.to 00/00/0000

    inserisco delle date in questo db nell' apposita tabella dai campi input tramite delle pagine asp e viene inputato il vaolre data in 00/00/0000 che pero non arriva correttamente al dvb perche il formato di default è 0000-00-00.

    ora avrei bisogno di una funzione che converte il formato data da 0000-00-00 a 00/00/0000

    mi sembra sia cvDate o una cosa del genere...

    grazie dell' aiuto..



  2. #2
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    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 = theDay & "/" & theMonth & "/" & theYear
    end if
    end function
    
    myDate = date()
    response.write convertDate(myDate)

  3. #3

    questa stinga

    la devo inserire prima del codice nsert giusto?

    io gli passo il vaolre da un forum, con questo codice

    '"& Request.Form("data_doc") & "'

    ma come faccio a indicargli che deve fare capo a quella funzione??

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.