vbscript – CDate

FUNCTION:  CDate( )


Implemented in version 1.0

You can determine the expression subtype by using the function VarType( ).

CDate(Date)

The CDate function converts any valid date and time expression to the variant of subtype Date.

The default date output will be of the format:  **/**/** The default time output will be of the format:  **:**:** *M Converted date values can range from January 1, 100 to December 31, 9999

Code:
<% anydate = « June 26, 1943″ %>
<% =CDate(anydate) %>

Output:
6/26/43

Code:
<% anydate = #6/26/43# %>
<% =CDate(anydate) %>

Output:
6/26/43

Code:
<% anytime= »2:23:59 PM » %>
<% =CDate(anytime) %>

Output:
2:23:59 PM

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Vous pouvez utiliser ces balises et attributs HTML : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>