Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the date and time by country
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01587430
Message ID:
01587449
Vues:
45
Windows provides facilities for that:

GetSystemTime() as UTC:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724390%28v=vs.85%29.aspx

Convert UTC Time to other Timezones:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724949%28v=vs.85%29.aspx

Since you're not in C++ it will require parsing out the data in complex ways with SUBSTR(), BINTOC() and CTOBIN(), but it is doable.
BOOL WINAPI SystemTimeToTzSpecificLocalTime(
  _In_opt_  LPTIME_ZONE_INFORMATION lpTimeZone,
  _In_      LPSYSTEMTIME lpUniversalTime,
  _Out_     LPSYSTEMTIME lpLocalTime
);
You could use this to pre-populate your memory block, and then just change the portions you need:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421%28v=vs.85%29.aspx
DWORD WINAPI GetTimeZoneInformation(
  _Out_  LPTIME_ZONE_INFORMATION lpTimeZoneInformation
);
>Any ideas of a site from which I can get datetime by country?
>
>>That is what is displayed on this site, there is no date there.
>>>Datetime is fine - just waht i want
>>>At the moment I am getting Thursday 01:24 ie DAY and TIME
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform