Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6661995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:20:35+00:00 2026-05-26T02:20:35+00:00

I need to convert a historical timestamp from GMT to BST in Delphi (Win32).

  • 0

I need to convert a historical timestamp from GMT to BST in Delphi (Win32). I can’t use the current regional settings in the OS to do the conversion because it won’t have the correct daylight saving (DST) offset for the historical time.

Is there a VCL API or Win32 API I can use?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:20:36+00:00Added an answer on May 26, 2026 at 2:20 am

    Delphi TZDB may be of use. It’s main feature is that has a class that handles times using the tz database, which, if it contains “historical enough” data, would let you use UTC as an intermediary. The tz database aims to have rules for all the time zones throughout the world and the various time shifts for things like leap years, daylight savings time, calendar changes, etc. as they relate to UTC since the Unix epoch (Midnight, Jan 1, 1970).

    Once you have the package installed, usage would be along the lines of the following:

    function ConvertFromGMTToBST(const AGMTTime: TDateTime): TDateTime;
    var
       tzGMT, tzBST: TTimeZone;
       UTCTime: TDateTime;
    begin
        tzGMT := TBundledTimeZone.GetTimeZone('GMT');
        tzBST := TBundledTimeZone.GetTimeZone('BST');
        UTCTime := tzGMT.ToUniversalTime(AGMTTime);
        Result := tzBST.ToLocalTime(UTCTime);
    end;
    

    The above relies on a few assumptions. First of all, that GMT and BST are valid aliases in the tz database. If not, then you’ll need to find the closest cities. (e.g. America/New_York). The second one is that I’m pretty sure my code is Delphi XE+ specific. TZDB claims to work on Delphi 6 and newer (and FreePascal) though, so the adjustments to work should be minor.

    Unfortunately regional dates and times are very complex, especially if you stretch back much before the 20th century.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Similar to: Convert historical time to GMT This time my scenario is: I need
I need to convert this Line from C to Delphi. Int CALLBACK EXPORT EXAMPLEFUNCTION(VOID){
I need to convert keys from type string to hash. The name of all
Need to convert a string to normal datetime format so it can be correctly
I need to convert from a grayscale PDF in RGB to CMYK. So i
I need to convert the linq query from generic ienumerable to arraylist. ArrayList myArrayList
I need to convert AMR audio file to MP3. How can I make it
I need to convert a 3-channel image to 1-channel in order to use Hough
I need to convert in procedure from string to decimal with fixed decimal separator
Need to convert the following code from Ruby to C#. However I'm kind of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.