what is the function to display current date?

Answer Posted / satya

You can use Date functions for this
ex-
1. Msgbox Date() or Msgbox Date
this will Returns the current system date.

2. MsgBox now() or MsgBox now
will Returns the current system date and Time.

3. MsgBox Time() or MsgBox Time
Returns - the current system time

Here is the list of All Date and Time Functions for
Reference.
Function -------> Description

CDate -Converts a valid date and time expression to the
variant of subtype Date
Date - Returns the current system date
DateAdd -Returns a date to which a specified time interval
has been added
DateDiff- Returns the number of intervals between two dates
DatePart- Returns the specified part of a given date
DateSerial- Returns the date for a specified year, month,
and day
DateValue - Returns a date
Day Returns- a number that represents the day of the month
(between 1 and 31, inclusive)
FormatDateTime - Returns an expression formatted as a date
or time
Hour - Returns a number that represents the hour of the day
(between 0 and 23, inclusive)
IsDate - Returns a Boolean value that indicates if the
evaluated expression can be converted to a date
Minute - Returns a number that represents the minute of the
hour (between 0 and 59, inclusive)
Month - Returns a number that represents the month of the
year (between 1 and 12, inclusive)
MonthName - Returns the name of a specified month
Now - Returns the current system date and time
Second - Returns a number that represents the second of the
minute (between 0 and 59, inclusive)
Time Returns - the current system time
Timer Returns - the number of seconds since 12:00 AM
TimeSerial - Returns the time for a specific hour, minute,
and second
TimeValue - Returns a time
Weekday - Returns a number that represents the day of the
week (between 1 and 7, inclusive)
WeekdayName - Returns the weekday name of a specified day
of the week
Year - Returns a number that represents the year

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is loose binding? Why is it not a good practice to use it?

578


What are lbound and ubound in the vbscript language?

604


In what way program "hello world" you can write in vbscript?

645


Which function is used in the vbscript language to convert the specified expression into a date type value?

520


where can i learn VB scripint ?

1595






Explain the operator precedence in vb script?

656


What is the difference between a dictionary and an array?

579


What purpose does ‘on error resume next’ serves?

549


who will create the object?

1481


Which in-built function related to an array joins substrings into one string in the vbscript language?

514


How will you get a string with the specified character the specified number of times in vbscript?

574


i need to sort the data using qtp script for this how i need to write a qtp script

3218


What is the difference between for loop and while loop?

550


Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

2032


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

547