FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Chage Date/Time in a File
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Chage Date/Time in a File
Posted: Wed Dec 21, 2005 02:22 PM

Is there a function which permits to retrieve/exchange Date and Time of last modif. in any file. Somethig similar to the FWH SetFDate()/GetFTime() functions?
Thanks
Rafael

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Chage Date/Time in a File
Posted: Thu Dec 22, 2005 06:36 AM
Rafael,

You can use Directory() to retrieve the date and time. Here you have a working sample:

#include "FWCE.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd TITLE "DateTime"
   
   @ 9, 2 BUTTON "Date-Time" ;
      SIZE 210, 30 ACTION ShowDateTime()

   ACTIVATE WINDOW oWnd
   
return nil   

function ShowDateTime()

   local aInfo := Directory( CurDir() + "\datetime.exe" )

   if Len( aInfo ) > 0
      MsgInfo( DToC( aInfo[ 1 ][ 3 ] ) )
      MsgInfo( aInfo[ 1 ][ 4 ] )
   endif      
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Chage Date/Time in a File
Posted: Thu Dec 22, 2005 07:11 AM

To change the date and time we need to use Windows API SetFileTime().

We are going to build a sample of its use.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Chage Date/Time in a File
Posted: Thu Dec 22, 2005 08:39 AM

Antonio.
Thanks. I'll apreciate that. I need a certain control over the dates and times of the DBFs so that I can control their syncronization through ActiveSync
Regards
Rafael

Continue the discussion