Display of date and time in local format in ASP using FormatDateTimeWe can display Formatted date and time by using FormatDateTime function of VBScript within ASP. This function can take only date , only time or both date and time and display in specified format. Here is the format the function FormatDateTime uses.
Here my_date is the date variable and Format takes the value of 0 to 4 and format the display based on this. The table at the end of this page displays all possible formats with different value of Format.
Here is the code to use FromatDateTime function.
Here the Format value is specified as 0 so the output of this is here .
For different values of Format ( 0 to 4 ) Here is a table of displays. Note that SetLocale is set to USA format. For other list of LCID value of local formats please see the article on today date and time.
There is a list of LCID values for SetLocale for different countries listed at Microsoft site.
This article is written by plus2net.com team.
Number of User Comments : 1