Solved

_ Formatting GMT time

Posted on 1998-11-07
4
223 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 138
Delphi Form ownership 4 90
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 67
Dev express lookupcombo 3 30
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

831 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