Solved

_ Formatting GMT time

Posted on 1998-11-07
4
221 Views
Last Modified: 2010-04-04
Hi, in C Builder, there's a command like FormatGMT

Does Delphi have something like that?

If not, is there anyone who can tell me how to format date for GMT.

Wein
0
Comment
Question by:Wein
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 40 total points
ID: 1346039
Find out your local time offset (ie: in NewZealand our normal time off set is 12 hours ahead of GMT) and apply this offset to the time given to you by Time (or just use GetSystemTime which returns UTC time which is equivalent to GMT). Then just format this as a normal date.

Cheers,

Raymond.
0
 

Author Comment

by:Wein
ID: 1346040
Can you write down the source?

Because i can't get the Api Call structure properly.

And i've tried to use GetTimeZoneInformation.

Write the complete source for all this.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1346041
Function GetFormatGMTTime : String;

var
  SystemTime : TSystemTime;
  GMTTime : TDateTime;

begin
  GetSystemTime(SystemTime);
  GMTTime := SystemTimeToDateTime(SystemTime);

// Format GMTTime any way you want... eg:
  Result := FormatDateTime('hh:mm:ss', GMTTime);
end;

0
 

Author Comment

by:Wein
ID: 1346042
Thank you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now