# tobi2502's solution

## to Gigasecond in the Delphi Pascal Track

Published at Jan 24 2021 · 0 comments
Instructions
Test suite
Solution

Given a moment, determine the moment that would be after a gigasecond has passed.

A gigasecond is 10^9 (1,000,000,000) seconds.

## Testing

In order to run the tests for this track, you will need to install DUnitX. Please see the installation instructions for more information.

If Delphi is properly installed, and `*.dpr` file types have been associated with Delphi, then double clicking the supplied `*.dpr` file will start Delphi and load the exercise/project. `control + F9` is the keyboard shortcut to compile the project or pressing `F9` will compile and run the project.

Alternatively you may opt to start Delphi and load your project via. the `File` drop down menu.

### When Questions Come Up

We monitor the Pascal-Delphi support room on gitter.im to help you with any questions that might arise.

### Submitting Exercises

Note that, when trying to submit an exercise, make sure the exercise file you're submitting is in the `exercism/delphi/<exerciseName>` directory.

For example, if you're submitting `ubob.pas` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/delphi/bob/ubob.pas`.

## Source

Chapter 9 in Chris Pine's online Learn to Program tutorial. http://pine.fm/LearnToProgram/?Chapter=09

## Submitting Incomplete Solutions

It's possible to submit an incomplete solution so you may request help from a mentor.

### uGigasecondTests.pas

``````unit uGigasecondTests;

interface
uses
DUnitX.TestFramework;

const
CanonicalVersion = '2.0.0.1';

type
[TestFixture]
TGigasecondTest = class(TObject)
public
[Test]
//    [Ignore('Comment the "[Ignore]" statement to run the test')]
procedure date_only_specification_of_time;

[Test]
[Ignore]
procedure second_test_for_date_only_specification_of_time;

[Test]
[Ignore]
procedure third_test_for_date_only_specification_of_time;

[Test]
[Ignore]
procedure full_time_specified;

[Test]
[Ignore]
procedure full_time_with_day_roll_over;
end;

implementation
uses
uGigasecond;

procedure TGigasecondTest.date_only_specification_of_time;
begin
end;

procedure TGigasecondTest.full_time_specified;
begin
end;

procedure TGigasecondTest.full_time_with_day_roll_over;
begin
end;

procedure TGigasecondTest.second_test_for_date_only_specification_of_time;
begin
end;

procedure TGigasecondTest.third_test_for_date_only_specification_of_time;
begin
end;

initialization
TDUnitX.RegisterTestFixture(TGigasecondTest);
end.``````
``````unit uGigasecond;

interface

type
tGigasecond = class
end;

implementation

uses
System.DateUtils, System.Sysutils;

const
Gigasecond = 1000000000;
begin
result := DateToISO8601(IncSecond(ISO8601ToDate(amoment), Gigasecond)).remove(19);
end;

end.``````