  | 
			
				SoftTree Technologies 
				Technical Support Forums
			 | 
		 
		  | 
	 
	 
	
	
	
		
	
	
	
		| Author | 
		Message | 
	 
	
		
			felixc 
			 
			
  
			
			
				Joined: 24 Sep 2007 Posts: 20 Country: Hong Kong | 
			 
			  
		 | 
		
			
				  How to get current time after running the job | 
				     | 
			 
			
				Hi, 
 
 
I want to send an email informing the finish of a time consuming job.  My code runs like this
 
	  | 
	
 
	  | 
	
 
  RunAndWait("job", "", 0, ID)
 
  MailSend("user ID", "", "someone", "Job finished at @T"HH\:MM\:SS"", "some message")
 
 | 
	 
 
 
 
When I got the email, I found that the time in subject is the starting time of job, not finishing time.  
 
 
Anything wrong ?
  | 
			 
		  | 
	 
	
		| Fri Oct 05, 2007 6:15 am | 
		          | 
	 
	
		  | 
	 
	
		
			SysOp 
			Site Admin 
			
  
			
			
				Joined: 26 Nov 2006 Posts: 7992
  | 
			 
			  
		 | 
		
			
				   | 
				     | 
			 
			
				That's right. All macro-variables are inserted before the job is run. Use date/time functions to obtain the current system date time values, as in example below
 
 
RunAndWait("job", "", 0, ID) 
 
 
	  | 
	
 
	  | 
	Use Now() to get the time
 
Dim( time_now, time )
 
Now( time_now )
 
Dim( my _message, string )
 
Concat( "Job finished at ", time_now, my_message )
 
MailSend("user ID", "", "someone", my_message, "some message") | 
	 
 
  | 
			 
		  | 
	 
	
		| Fri Oct 05, 2007 9:10 am | 
		          | 
	 
	
		  | 
	 
	
		 | 
	 
 
  
	 
	    
	   | 
	
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
   
 
		 | 
	 
	  |