| Author | 
         | 
          
      
        
         
         scottmi1 Groupie 
          
  
  Joined: July 11 2006 Location: United States
 Online Status: Offline Posts: 60
          | 
        
         
          
           | Posted: March 06 2009 at 13:09 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Having a problem getting the datetime function to work in my macro.
 
 This formula works:
 date(ph_regexdiff("<date>","</date>","[LOCAL1]",1,0))
 Source value is "03/06/09" and returned value is "03/06/2009"
 
 And this formula works:
 time(ph_regexdiff("<time>","</time>","[LOCAL1]",1,0))
 Source value is "12:10 PM" and returned value is "12:50:00"
 
 But this formula doesn't (it evaluates to !):
 datetime(ph_regexdiff("<date>","</date>","[LOCAL1]",1,0),ph_regexdiff("<time>","</time>","[LOCAL1]",1,0))
 
 So I tried this and it doesn't work either:
 datetime("03/06/09","12:10 PM")
 
 Any ideas what I'm doing wrong?    
 
 Mike..
         | 
        
       
        | Back to Top | 
         
          
         | 
        
       
       
        |   | 
       
        
         
         BeachBum Super User 
          
  
  Joined: April 11 2007 Location: United States
 Online Status: Offline Posts: 1880
          | 
        
         
          
           | Posted: March 06 2009 at 13:39 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Try separating the 2 with a + instead of a ,
 
 datetime(ph_regexdiff("<date>","</date>","[LOCAL1]",1,0) + ph_regexdiff("<time>","</time>","[LOCAL1]",1,0)) 
 
  Edited by BeachBum - March 06 2009 at 13:41
  __________________ Pete - X10 Oldie
         | 
        
       
        | Back to Top | 
         
          
         | 
        
       
       
        |   | 
       
        
         
         jbbtex Senior Member 
          
 
  Joined: February 15 2007 Location: United States
 Online Status: Offline Posts: 181
          | 
        
         
          
           | Posted: March 06 2009 at 13:42 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
try it like this:
 
 datetime("03/06/09, 12:10pm")
  __________________ Brady
 
 "Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity." - Gen. George S. Patton
         | 
        
       
        | Back to Top | 
         
          
         | 
        
       
       
        |   | 
       
        
         
         scottmi1 Groupie 
          
  
  Joined: July 11 2006 Location: United States
 Online Status: Offline Posts: 60
          | 
        
         
          
           | Posted: March 06 2009 at 14:05 | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Brady - your correction worked and gave me the clue I needed to fix my original formula.
 
 Pete - I replaced the comma with a "+" and while I didn't get an error, the returned value was blank.  I then figured out I needed both.  Here's the formula that works:
 
 datetime(ph_regexdiff("<date>","</date>","[LOCAL1]",1,0) + "," + ph_regexdiff("<time>","</time>","[LOCAL1]",1,0))
 
 Thanks for the quick replies!
 
 Mike..
         | 
        
       
        | Back to Top | 
         
          
         | 
        
       
       
        |   |       
      | 
    
   
  |