?
Solved

_ Formatting GMT time

Posted on 1998-11-07
4
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 160 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

777 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