Recent

Author Topic: is there any unit, command or procedure that i can acess real time in pascal?  (Read 419 times)

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
p l s    h e l p
« Last Edit: February 29, 2020, 02:21:27 pm by anbadaothcsts@gmail.com »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8731
  • FPC developer.

anbadaothcsts@gmail.com

  • New Member
  • *
  • Posts: 18
p l s    h e l p

Define "real time"

Idk how to explain, it's like:
Code: Pascal  [Select][+][-]
  1. Time:= time(Vietnam:{country});
  2. write('The time is', time);
  3.  
and then execute
Code: Pascal  [Select][+][-]
  1. The time is 19:30
  2.  
  3.  

MarkMLl

  • Hero Member
  • *****
  • Posts: 1233
Running on what operating system, and with your locale set to what?

While you're at it, what version of Lazarus and FPC?

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

winni

  • Hero Member
  • *****
  • Posts: 1814
Hi!

Do This:

Code: Pascal  [Select][+][-]
  1. uses ....lazsysutils;
  2.  
  3. const TimeZoneVietnam = 8;
  4. var TheTime : TDateTime;
  5. ...
  6. TheTime := NowUTC+TimeZoneVietnam/24;
  7. write (TimeToStr(TheTime) );
  8.  

Winni

 

TinyPortal © 2005-2018