FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour I get the server time and date "time.windows.com"?
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
I get the server time and date "time.windows.com"?
Posted: Sat Aug 18, 2012 03:08 PM
Good day,

I need to get the time and date server GMT-UTC "time.windows.com" or any other server time and date,
this because I have a schedule control application and users are "very creative" and atrazann time!.

I've tried with the winapi function:
Code (fw): Select all Collapse
time ( &rawtime );
  ptm = gmtime ( &rawtime );
        
  hour = ptm->tm_hour;
  min = ptm->tm_min;
  sec = ptm->tm_sec;


and returns the time and date but the PC.

also with the command:

Code (fw): Select all Collapse
NET TIME \\Servidor_Tiempo /SET


I get no result ...

thanks,

regards
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: I get the server time and date "time.windows.com"?
Posted: Sun Aug 19, 2012 10:31 PM

Hi,

Fucky has those functions.

Or you could retrieve from:

http://www2.roa.es/hora/index.html

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 02:37 AM

Hello Albeiro

do you need a UTC time?

what do you use harbour or xharbour?

Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 03:48 AM

Hello Daniel,

I use Harbour..

regards,

Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 03:52 AM

thanks lucasbeltran,

'll check..

Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 512
Joined: Mon Oct 17, 2005 10:38 AM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 07:57 AM
lucasdebeltran wrote:Hi,

Fucky has those functions.

Or you could retrieve from:
http://www2.roa.es/hora/index.html


Where I can buy the Funcky library ? I have them for the old Clipper, but I never found a place where to order the new version.
Thanks a lot.
Massimo.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 10:20 AM
Daniel Garcia-Gil wrote:Hello Albeiro

do you need a UTC time?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 01:46 PM

Gracias antonio,

Voy a Probar,

Saludos,

Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 02:38 PM

Daniel,

Yes, I need a UTC time..

thanks,

Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: I get the server time and date "time.windows.com"?
Posted: Mon Aug 20, 2012 04:33 PM
Hello

usa estas funciones propias del API de harbour, ve si te resulta, el punto es que el PC debe estar en Hora correcta

Code (fw): Select all Collapse
function main()

   ? UTCTime()
   

return nil

static function UTCTime( dt )
   
   DEFAULT dt := hb_DateTime()
   
return hb_ntot( ( hb_tton( dt ) * 86400 - hb_utcOffset() ) / 86400 )
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
( I get the server time and date "time.windows.com"? ) Resue
Posted: Wed Aug 22, 2012 05:23 AM

Hello Daniel,

Funciona con tu ejemplo,
Gracias,

Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: I get the server time and date "time.windows.com"?
Posted: Wed Feb 26, 2014 06:32 PM

Daniel, como haria en FiveWin for xHarbour? No uso Harbour.

Gracias,

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion