Board index » delphi » TDateTime converting to local TDateTime

TDateTime converting to local TDateTime

Hi

Small problem here. Lets say that i have a TDateTime like this on a
European Computer that uses the this TDateTime format.

5/6/2002 23:10:23

And i send this to an US computer. Now US dont use the 24 hour system but
the 12 hour and the date looks a little different. How can i format the
TDateTime value so it will be dispalyed correctly to any user on a windows
machine?

Is there a DateTimeToLocal?

Thanx In Advance
Romeo

 

Re:TDateTime converting to local TDateTime


On 25 Jul 2002, "Romeo I" <romeo_isaks...@hotmail.com> wrote:

Quote
> Small problem here. Let's say that i have a TDateTime like this on a
> European Computer that uses the this TDateTime format.

> 5/6/2002 23:10:23

> And i send this to an US computer. Now US don't use the 24 hour system
> but the 12 hour and the date looks a little different. How can i
> format the TDateTime value so it will be dispalyed correctly to any
> user on a windows machine?

How are you "sending" the data?  If you send it as a floating point
number instead of a string you won't have to worry about regional date
formatting issues.

--
-Mike (TeamB)

Re:TDateTime converting to local TDateTime


I was thinking that i will use Now function to retrieve the current date and
time and the save it to a file as a string. And when the other user on a
differnet computor. it will read the string that the is in the file and the
date and time will be formated to his "local". So if a time looks like this
23:10:01 it will look like this IF he uses US-time:
11:10:01 AM

How can i do this?

How do i convert a TDateTime to a floating point. Can you show me an
example?

Thanx In Advance,
Romeo

"Mike Williams (TeamB)" <mi...@remove.aps-soft.com> skrev i meddelandet
news:Xns9256784C95804mikewteamb@207.105.83.65...

Quote
> On 25 Jul 2002, "Romeo I" <romeo_isaks...@hotmail.com> wrote:

> > Small problem here. Let's say that i have a TDateTime like this on a
> > European Computer that uses the this TDateTime format.

> > 5/6/2002 23:10:23

> > And i send this to an US computer. Now US don't use the 24 hour system
> > but the 12 hour and the date looks a little different. How can i
> > format the TDateTime value so it will be dispalyed correctly to any
> > user on a windows machine?

> How are you "sending" the data?  If you send it as a floating point
> number instead of a string you won't have to worry about regional date
> formatting issues.

> --
> -Mike (TeamB)

Re:TDateTime converting to local TDateTime


On 25 Jul 2002, "Romeo I" <romeo_isaks...@hotmail.com> wrote:

Quote
> How do i convert a TDateTime to a floating point. Can you show me an
> example?

It already is a floating point number.

  Caption := Format('%0.5f', [Now]);

--
-Mike (TeamB)

Other Threads