myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


           



Wise Script Editor - comparing dates

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Scripting Technologies] >> Wise Solutions >> Wise Script Editor - comparing dates Page: [1]
Login
Message << Older Topic   Newer Topic >>
Wise Script Editor - comparing dates - 4/16/2008 12:59:25 PM   
skrummen


Posts: 179
Score: 4
Joined: 6/7/2001
Status: offline
I am looking for Wise script editor code that will compare two dates.

Example:
File Modified date = 03/13/08
compare to date = 01/18/08

I want to be able to compare the 2 dates and have Wise Script Editor know that 01/18/08 is greater (older) than 03/13/08.

I tried parsing the variables and changing the format to YY/MM/DD and then comparing the variables but now it appears the month isn't calculating correctly since 03 is greater than 01.

Any help would be appriciated.

_____________________________

Shane Krummen
shane_krummen@cinfin.com
Post #: 1
RE: Wise Script Editor - comparing dates - 4/16/2008 4:02:39 PM   
skrummen


Posts: 179
Score: 4
Joined: 6/7/2001
Status: offline
I think I figured this out.

I ended up creating a .vbs file that is called from the script that takes variables from the wise script, executes the vbs script and then brings the result back to wise again.

vbs code:

'(Declarations) 
FILEMOD = GetVariable("FILEMOD")
DEATHDATE = GetVariable("DEATHDATE")
FILEMOD = CDate(FILEMOD)
DEATHDATE = CDate(DEATHDATE)
If DateDiff("d", FILEMOD, DEATHDATE) >= 1 Then
   SetVariable "DATECOMPARE", 1
Else
   SetVariable "DATECOMPARE", 0
End If
'End of (Declarations)


_____________________________

Shane Krummen
shane_krummen@cinfin.com

(in reply to skrummen)
Post #: 2
Page:   [1]
All Forums >> [Scripting Technologies] >> Wise Solutions >> Wise Script Editor - comparing dates 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




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.203