Posts: 19
Threads: 8
Joined: May 2011
Reputation:
0
05-31-2011, 12:54 PM
I need the script for displaying date format exactly as below..
eg: if date is may 31 2011 then it has to display as - "2011-05-31"
For example if the date is "01/02/2012" then it should display as "2012-02-01" and it should not display as "2012-2-1"
Please help
Posts: 61
Threads: 1
Joined: Jul 2009
Reputation:
0
05-31-2011, 12:55 PM
Hi
Use format(dtDate, "yyyy-MM-dd") function. Just check if the function is Format or FormatDate only.
Posts: 19
Threads: 8
Joined: May 2011
Reputation:
0
05-31-2011, 01:03 PM
Verified but its throwing error
currDate1 = FormatDateTime(dtDate, "yyyy-mm-dd")
PRINT currDate1
Type mismatch: '[string: "yyyy-mm-dd"]'
"currDate1 = FormatDateTime(dtDate, "yyyy-mm-dd")".
Posts: 107
Threads: 9
Joined: Apr 2011
Reputation:
0
05-31-2011, 01:25 PM
Hi... You can get Date in D, M, YYYY format using DatePart method. In order to display 5 as '05', You need to comeup with ur own function. As far as i know, there is no such method in VBScript.