• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

_ Formatting GMT time

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
Wein
Asked:
Wein
  • 2
  • 2
1 Solution
 
rwilson032697Commented:
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
 
WeinAuthor Commented:
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
 
rwilson032697Commented:
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
 
WeinAuthor Commented:
Thank you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now