Lazarus

Free Pascal => Beginners => Topic started by: anbadaothcsts@gmail.com on February 29, 2020, 01:53:09 pm

Title: is there any unit, command or procedure that i can acess real time in pascal?
Post by: anbadaothcsts@gmail.com on February 29, 2020, 01:53:09 pm
 p l s    h e l p
Title: Re: is there any unit, command or procedure that i can acess real time in pascal?
Post by: marcov on February 29, 2020, 02:13:35 pm
p l s    h e l p

Define "real time"
Title: Re: is there any unit, command or procedure that i can acess real time in pascal?
Post by: anbadaothcsts@gmail.com on February 29, 2020, 02:24:47 pm
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.  
Title: Re: is there any unit, command or procedure that i can acess real time in pascal?
Post by: MarkMLl on February 29, 2020, 02:47:08 pm
Running on what operating system, and with your locale set to what?

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

MarkMLl
Title: Re: is there any unit, command or procedure that i can acess real time in pascal?
Post by: winni on February 29, 2020, 02:53:53 pm
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