Dear Ben

Rather than trying to figure out whether to increment or decrement the
other date time picker, why not rather just use an offset, like below:

const
  offset = 5/24; // 5 hours

procedure TForm1.dt1Change(Sender: TObject);
begin
  dt2.Time := dt1.Time - offset;
end;

procedure TForm1.dt2Change(Sender: TObject);
begin
  dt1.Time := dt2.Time + offset;
end;

Ideally, store the offset somewhere besides a constant so that it can be
changed.

Stephen

> -----Original Message-----
> From: Ben none [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, 21 June 2003 4:33 p.m.
> To: Multiple recipients of list delphi
> Subject: [DUG]: Datetimepickers
> 
> 
> Gidday, Ive got 2 problems
> 
> I have two datetimepickers which are both set to dkTime. The 
> first one 
> represents the outside new zealand time (timezone related 
> time) and second 
> datetimepicker represents the new zealand time.
> 
> There is also a combobox which the user chooses to change the 
> time zone. One of the selection would be say 5 hours from our 
> current time which ever 
> country that is.
> I want the newzealand time to increment by 1 when the other timezone 
> datetimepicker increments by one. This I figured out how to 
> code but when I decrement the timezone datetimepicker so that 
> the newzealand time 
> picker decrements as well, it doesnt. It increments instead.
> 
> Anyone know?
> 
> Ben Iti
> 
> _________________________________________________________________
> Surf the net and talk on the phone with Xtra Jetstream @  
> http://www.xtra.co.nz/products/0,,5803,00.html !
> 
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED] 
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to