Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Date Formating

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59249
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Date Formating
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Date Formating - 4/17/2008 3:34:24 AM   
  ¥TheApocalypse¥

 

Posts: 1
Score: 0
Joined: 4/16/2008
Status: offline
Hi,

I getting started with vbscript, so I need some help

I'm trying to format or convert the system date to this "MM-dd-yyyy"

For example I do it in vba and it work.
here is what i have so far,

Dim filesys, dte, i, sourcefolder
Set filesys = CreateObject("Scripting.FileSystemObject")
Set sourcefolder = filesys.GetFolder("sourcefolder")


'dte = FormatDateTime((Date - 10), "MM-dd-yyyy")
dte = Date - 10

For i = dte To (Date - 1) Step 1
'i = FormatDateTime(i, "MM-dd-yyyy")
 
  If Not filesys.fileexists(sourcefolder & "\" & i & ".xls") Then
           MsgBox ("call other program and pass the following parameter (i & '.xls' )")
              
   End If

Next
WScript.Quit

I'll appreciate your help.
 
 
Post #: 1
 
 RE: Date Formating - 4/17/2008 9:40:35 PM   
  TomRiddle


Posts: 165
Score: 4
Joined: 2/7/2008
Status: offline
You had a couple of errors in there.
Does this do the trick for you?


      

< Message edited by TomRiddle -- 4/17/2008 9:43:28 PM >

(in reply to ¥TheApocalypse¥)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Date Formating Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts