Re: [fpc-pascal] Wrong Time from Now() or Time() = [SOLVED]
I found the problem for the the wrong time. I checked /etc/localtime and this was ok, but there was also a file /etc/timezone with a wrong entry ! fpc seems to first checks the /etc/timezone and then /etc/localtime Kylix, and also all other programs i've tested do it in the different order! br, Alex vince coen schrieb: Hi; Have you checked what time zone you have set up? V. On Thursday 04 December 2008, you wrote: Valdas Jankūnas schrieb: Alexander Bauer rašė: I have a strange problem with fpc 2.2.2 on Ubuntu Linux. The function Now(); did not return the right time ?!? It returns the time UTC - 6 hours. Any suggestions ? br, Alex try GetTime or GetLocalTime from SysUtils unit. It's always the same time. UTC - 6 hours. But it's not a problem of fpc or the functions, it must be a problem of the Linux Ditribution. On Ubuntu 8.04 Desktop the time is correct. I use a system based on Ubuntu Server 8.04 and get a wrong time. Does someone know what system components are relevant for the time functions ? Perhaps the system i use has something missing. Btw. the linux date command shows the correct time, of course. Alex ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Wrong Time from Now() or Time()
I have a strange problem with fpc 2.2.2 on Ubuntu Linux. The function Now(); did not return the right time ?!? It returns the time UTC - 6 hours. Any suggestions ? br, Alex ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Wrong Time from Now() or Time()
Valdas Jankūnas schrieb: Alexander Bauer rašė: I have a strange problem with fpc 2.2.2 on Ubuntu Linux. The function Now(); did not return the right time ?!? It returns the time UTC - 6 hours. Any suggestions ? br, Alex try GetTime or GetLocalTime from SysUtils unit. It's always the same time. UTC - 6 hours. But it's not a problem of fpc or the functions, it must be a problem of the Linux Ditribution. On Ubuntu 8.04 Desktop the time is correct. I use a system based on Ubuntu Server 8.04 and get a wrong time. Does someone know what system components are relevant for the time functions ? Perhaps the system i use has something missing. Btw. the linux date command shows the correct time, of course. Alex ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Problem with threads and cwstrings
Hi, i have a problem when i use cwstrings together with threads on linux. I made a simple program which create threads in an endless loop. Every thread only does a sleep(1) and then finish. Without 'cwstrings' everything works fine. But when i include 'cwstrings' the program eats more and more memory. What is the problem ? FPC 2.2.1 (I also tested with FPC 2.3.1) with Ubuntu 8.04 Alex -- threaddemo.lpr -- program threaddemo; {$mode objfpc}{$H+} uses cthreads, cwstring, SysUtils, mythread; var i: integer; bTerm: boolean; Thread: TmyThread; begin i := 0; bTerm := false; while not bTerm do begin Thread := TmyThread.create(true); Thread.Resume; Inc(i); Sleep(1); WriteLn('Thread #' + IntToStr(i)); end; Halt(0); end. -- mythread.pas -- unit mythread; interface uses Classes, SysUtils; type TmyThread = class(TThread) private public Constructor Create(CreateSuspended : boolean); procedure Execute; override; end; implementation { TmyThread } Constructor TmyThread.Create(CreateSuspended : boolean); begin inherited create(CreateSuspended); FreeOnTerminate:=true; end; procedure TmyThread.Execute; begin sleep(1); end; end. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal