Finding Today date and time and changing the format on location
Here d_today is the variable and it will store the value of Date. Here is the code to display the present date.
Output is :11-11-2010
To display the time along with the date we have to use Now.
Output is :11-11-2010 10:18:01
The code above will print todays date along with time Hour: Minute : Second.
To display only time we can use Time function.
Output is :10:33:38
We can change the date format displayed based on our requirement by using SetLocal function. Let us try to display date in UK English format. Here is the code.
There is a list of LCID values for SetLocale for different countries listed at Microsoft site.
var_Locale = SetLocale(2057) ' UK
d_today=Now ' Along with time
Read how DateDiff used in MSSQL query
Be the first to post comment on this article :