Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Comparision of two time stamps

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Comparision of two time stamps
  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 >>
 Comparision of two time stamps - 4/8/2008 1:29:13 AM   
  shahid09

 

Posts: 58
Score: 0
Joined: 1/22/2007
Status: offline
 
Hi All,

I want to compare two timestamp and want to get the one which is most latest one. my time stamp format is

TimeStamp1  = 07/03/2008 10:34:55:93746
TimeStamp2 = 07/01/2008 13:35:05:15023

I want to compare these timestamps and get the one which is the most current. In thiis case Timestamp1 is the answer. I tried to create write code but it is not working.


      

Problem in this code is  If newDate is greater but time is lessor I don't get desired output.

Thanks
MK
 
 
Post #: 1
 
 RE: Comparision of two time stamps - 4/8/2008 1:38:58 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
Wow. The code you posted wouldn't even run. Please post the code that you are actually running.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to shahid09)
 
 
Post #: 2
 
 RE: Comparision of two time stamps - 4/8/2008 1:53:36 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi shahid09,

you may try this:


      

output:


      

but you'll have to test it carefully, because possible locale problems may make my tests
useless.

Good luck!

ehvbs

(in reply to shahid09)
 
 
Post #: 3
 
 
 
  

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 >> Comparision of two time stamps 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