| Author |  | 
      
        | MAWilsonPE Newbie
 
  
  
 Joined: May 30 2008
 Location: United States
 Online Status: Offline
 Posts: 18
 | 
          I have created a log file to record hourly local weather history from Weather Exchange.  I want to archive each day's history in a file with the date in the file name.  How do I use the today() function in a file name?
           | Posted: May 15 2010 at 07:51 | IP Logged |   |  
           | 
 |  
 ph_copyfile("c:\Program Files\WxEx\csv\history.log", "c:\Program Files\WxEx\csv\history-today().log", 1)
 
 returns a file name of:  history-today().log  ;)
 
 Thanks
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          I use this...
           | Posted: May 15 2010 at 09:56 | IP Logged |   |  
           | 
 |  
 
 
| Code: 
 
    
    | 
      
       | string( today(), "mmmm d") + " " + string(now(),"h.mm am/pm") |  |  |  
 So try...
 
 
 
| Code: 
 
    
    | 
      
       | ph_copyfile("c:\Program Files\WxEx\csv\history.log", "c:\Program Files\WxEx\csv\history-"+string( today(), "mmmm d") + " " + string(now(),"h.mm am/pm")+".log", 1) |  |  |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | MAWilsonPE Newbie
 
  
  
 Joined: May 30 2008
 Location: United States
 Online Status: Offline
 Posts: 18
 | 
          That Works! Thanks....
           | Posted: May 15 2010 at 13:21 | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  |