Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to synchronize system date and time
Message
De
26/03/2007 07:20:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/03/2007 22:38:58
Hee Lim Wang
Fantasy Software Enterprise
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01207544
Message ID:
01208406
Vues:
21
>since we got a string called "ltNow"
>now how to set the sys date time with "ltNow" ?
>
>
>lcTemp = forcepath(sys(2015)+'.tmp', 'd:\aaa')
>Strtofile('x',m.lcTemp)
>Adir(arrFile,m.lcTemp)
>Erase (m.lcTemp)
>ltNow = (Ctot(Transform(Dtoc(arrFile[3],1),'@R ^9999/99/99')+' '+arrFile[4]))
SetSystemDate(m.ltNow)

Function SetSystemDate
  Lparameters tdDate
  Declare Integer SetLocalTime In win32api String @ lpTime
  Declare Integer GetLocalTime In win32api String @ lpTime
  Local lpCurrent, lcNewTime
  lpCurrent = Space(40)
  GetLocalTime(@lpCurrent) && save current

  lcNewTime = Num2Word(Year(m.tdDate))+;
    Num2Word(Month(m.tdDate))+;
    Num2Word(Dow(m.tdDate))+;
    Num2Word(Day(m.tdDate))+;
    Substr(m.lpCurrent,9)

  SetLocalTime(@lcNewTime)
  SetLocalTime(@lcNewTime)
EndFunc

Function Num2Word
  Lparameters tnDecimal
  Return Chr(m.tnDecimal%256)+Chr(Int(m.tnDecimal/256))
EndFunc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform