VBScript La fonction DateSerial
❮ Référence complète de VBScriptLa fonction DateSerial renvoie un Variant de sous-type Date pour une année, un mois et un jour spécifiés.
Syntaxe
DateSerial(year,month,day)
Parameter | Description |
---|---|
year | Required. A number between 100 and 9999, or a numeric expression. Values between 0 and 99 are interpreted as the years 19001999. For all other year arguments, use a complete four-digit year |
month | Required. Any numeric expression |
day | Required. Any numeric expression |
Exemples
Exemple 1
<%
response.write(DateSerial(2010,2,3))
%>
La sortie du code ci-dessus sera :
2/3/2010
Exemple 2
Soustraire 10 jours :
<%
response.write(DateSerial(2010,2,3-10))
%>
La sortie du code ci-dessus sera :
1/24/2010
❮ Référence complète de VBScript