Recent

Author Topic: is there any unit, command or procedure that i can acess real time in pascal?  (Read 935 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

  • Administrator
  • Hero Member
  • *
  • Posts: 11446
  • 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: 6683
Running on what operating system, and with your locale set to what?

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

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3197
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