Script Data E Ora

marconi

Utente Attivo
1 Feb 2008
50
0
0
Ciao a tutti ho un problema con questo script non riesco a capire dove devo inseririe i dati di input, perfavore aiutatemi!!
<%
' countdown.asp: Countdown to Event
' Version 1.0
' Copyright (C) 1998 John Watson
'
' E-mail: [email protected]
'
' Get the latest version and full documentation
' at http://www.watson-net.com/
'
' PURPOSE
'
' Contains functions for displaying a text countdown to a certain
' date (e.g. It is only 5 days 3 minutes until x). It will countdown
' years, months, days, and minutes.
'
' INPUTS
'
' dTargetDate: the date to countdown to (02/15/2008 string)
' dTargetTime: the time to countdown to (16:05:00 string)
' sEventName: the name of the event to countdown to
'
' RETURNS
'
' None
'
' LICENSE
'
' This library is free software; you can redistribute it and/or
' modify it under the terms of the GNU Library General Public
' License as published by the Free Software Foundation; either
' version 2 of the License, or (at your option) any later version.
'
' This library is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
' Library General Public License for more details.
'
' You should have received a copy of the GNU Library General Public
' License along with this library; if not, write to the
' Free Software Foundation, Inc., 59 Temple Place - Suite 330,
' Boston, MA 02111-1307, USA.

Function CountDown(dTargetDate, dTargetTime, sEventName)
DIM D1, D2, T1, T2, Years, Months, Days, Hours, Minutes, Temp, since

D2 = DateValue(dTargetDate)
T2 = TimeValue(dTargetTime)

If (D2 < Date) Then
since = TRUE
D1 = DateValue(dTargetDate)
D2 = Date
T1 = TimeValue(dTargetTime)
T2 = Time
Else
since = FALSE
D1 = Date
T1 = Time
End If

Years = Year(D2) - Year(D1)
Months = Month(D2) - Month(D1)
Days = Day(D2) - Day(D1)

Hours = Hour(T2) - Hour(T1)
Minutes = Minute(T2) - Minute(T1)

If (Months < 0) Then
Months = Months + 12
Years = Years - 1
End If

If (Days < 0) Then
Days = Days + DaysIn(Month(D1))
Months = Months - 1
End If

If (Hours < 0) Then
Hours = Hours + 24
Days = Days - 1
End If

If (Minutes < 0) Then
Minutes = Minutes + 60
Hours = Hours - 1
End If

Temp = ""

If (Years <> 0) Then
Temp = Temp & Years
If (Years = 1) Then
Temp = Temp & " year "
Else
Temp = Temp & " years "
End If
End If
If (Months <> 0) Then
Temp = Temp & Months
If (Months = 1) Then
Temp = Temp & " month "
Else
Temp = Temp & " months "
End If
End If
If (Days <> 0) Then
Temp = Temp & Days
If (Days = 1) Then
Temp = Temp & " day "
Else
Temp = Temp & " days "
End If
End If
If (Hours <> 0) Then
Temp = Temp & Hours
If (Hours = 1) Then
Temp = Temp & " hour "
Else
Temp = Temp & " hours "
End If
End If
If (Minutes <> 0) Then
If (Temp <> "") Then Temp = Temp & " and "
Temp = Temp & Minutes
If (Minutes = 1) Then
Temp = Temp & " minute "
Else
Temp = Temp & " minutes "
End If
End If
If (Since) Then
Temp = "It has been " & temp & " since " & sEventName
Else
Temp = "Only " & temp & " until " & sEventName
End If

Countdown = Temp
End Function

' Returns the number of days in a given month
Function DaysIn(MonthNum)
Select Case MonthNum
Case 1 DaysIn = 31 'jan
Case 2 DaysIn = 28 'feb
Case 3 DaysIn = 31 'mar
Case 4 DaysIn = 30 'apr
Case 5 DaysIn = 31 'may
Case 6 DaysIn = 30 'jun
Case 7 DaysIn = 31 'jul
Case 8 DaysIn = 31 'aug
Case 9 DaysIn = 30 'sep
Case 10 DaysIn = 31 'oct
Case 11 DaysIn = 30 'nov
Case 12 DaysIn = 31 'dec
End Select
End Function
%>

Se è possibile al posto di stampare l'evento come devo fare per fare un redirect? grazie
 
Discussioni simili
Autore Titolo Forum Risposte Data
Cosina script data aggiornamento pagina Javascript 1
M Aiuto con script di ricerca video youtube data api v3 Javascript 1
M Script per scrivere la data su vari file immagine PHP 12
A Script che restituisce il file con data di modifica più recente di una directory PHP 15
F Somma di più tabelle da script Javascript 0
L Script per convertire numeri in parole Javascript 2
H Eliminazione script. Photoshop 0
S Script Google Translate scomparso HTML e CSS 3
P lanciare script asp (o php) da jquery Javascript 1
G Script notifiche dekstop aiuto Javascript 0
G [PHP] Creare script di prenotazione con controllo disponibilità. PHP 7
P Passare solo alcuni parametri a script per CSV PHP 0
M Collegamento tra form html e script php PHP 4
F Script java elenco alfabetico non funziona Javascript 3
F Script non funzionante. Devo elencare in ordine alfabetico un elenco di nominativi, ma lo script non Javascript 2
P Script upload immagini jQuery 0
M Premature end of script headers PHP 1
R Distribuire uno Script "Facebook Auto Post" PHP 0
F Creazione script Tv Presentati al Forum 1
N Script elenco file HTML HTML e CSS 5
felino PHP e script generazione file excel PHP 2
MarcoGrazia Se non sai se riceverai da GET o da POST, puoi verificarlo e far scegliere allo script. Snippet PHP 0
Beppe2 Ritardare esecuzione script Javascript 2
R Primo script in PHP / CSS PHP 4
felino Script PHP per leggere un file JSON. autenticazione? PHP 4
T [a pagamento] programmatore PHP che mi aiuti a migrare gli script da vecchia versione PHP a nuova Offerte e Richieste di Lavoro e/o Collaborazione 1
T script jquery non funziona più dopo il passaggio a MVC jQuery 5
F Aiuto java script Javascript 2
Max 1 [PHP] Script che funziona in locale e non online PHP 16
K Help: problema con uno script di booking in php! PHP 0
O [PHP] inviare dati da form e script ajax PHP 0
P [PHP] Aggiungere un mio script a prestashop? PHP 10
D [Javascript] inserire uno script in un file php Javascript 6
Gabriele15497514 php testo errato durante la lettura del file txt quando lo script viene eseguito contemporaneamente PHP 3
R [Javascript] Aiuto su questo script Javascript 2
M [HTML] Stesso script su 2 blog CMS (Content Management System) 4
romeocharly [PHP] Script per rinominare in automatico le immagini inviate da ftp PHP 0
elpirata [Javascript] Lo script alle volte funzione altre volte no Javascript 0
A [PHP] Script con array con numeri che iniziano per 00 PHP 2
F [HTML] Failed script su coffee cookies HTML e CSS 1
TpD [PHP] Script per organizzazione presenza eventi PHP 3
D [PHP] script che invii una mail automatica dopo risposta ad una discussione di un forum PHP 0
T interpretare uno script php non fatto da me... PHP 3
Cosina Modifica script textarea jQuery 0
O Script PHP e loro visibilità PHP 4
A [PHP] Script Ip camera su altervista senza sottocartelle PHP 6
M [PHP] Problema script ricezione e invio posta... PHP 1
Y Codice AdSense su script php PHP 4
L [PHP] Problema Script 'Not Found' PHP 4
webmachine [PHP] Script per censurare parole PHP 4

Discussioni simili