AdaCL.Calendar

Some calendar utility functions.

More...

Entities

Subprograms

Date_Time_Image
Date_Time_Wide_Image
Date_Time_Wide_Wide_Image
Duration_Image
Duration_Wide_Image
Duration_Wide_Wide_Image
Split_Duration
To_Second_Duration
To_Second_Number

Description

No, I have not created some new Calendar class - yet. Just a few calendar tools.

Date_Time_Image [source]

64 function Date_Time_Image
65 (Date : Ada.Calendar.Time;
66 Fraction_Digits : Natural := 1)
67 return String with
68 Pure_Function, Post => Date_Time_Image'Result'Length = 20 + Fraction_Digits;

Image representation with Fractional seconds.

Date of type Time

value to create the image from

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Date_Time_Wide_Image [source]

76 function Date_Time_Wide_Image
77 (Date : Ada.Calendar.Time;
78 Fraction_Digits : Natural := 1)
79 return Wide_String is
80 (Ada.Characters.Conversions.To_Wide_String (Date_Time_Image (Date, Fraction_Digits))) with
81 Pure_Function, Inline, Post => Date_Time_Wide_Image'Result'Length = 20 + Fraction_Digits;

Wide image representation with Fractional seconds.

Date of type Time

value to create the image from

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Date_Time_Wide_Wide_Image [source]

89 function Date_Time_Wide_Wide_Image
90 (Date : Ada.Calendar.Time;
91 Fraction_Digits : Natural := 1)
92 return Wide_Wide_String is
93 (Ada.Characters.Conversions.To_Wide_Wide_String (Date_Time_Image (Date, Fraction_Digits))) with
94 Pure_Function, Inline, Post => Date_Time_Wide_Wide_Image'Result'Length = 20 + Fraction_Digits;

Wide wide image representation with Fractional seconds.

Date of type Time

value to create the image from

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Duration_Image [source]

103 function Duration_Image
104 (Seconds : Duration;
105 Hour_Digits : Positive := 4;
106 Fraction_Digits : Natural := 1)
107 return String with
108 Pure_Function,
109 Pre => Hour_Digits >= 2 and then Seconds <= 3_600.0 * (10**Hour_Digits),
110 Post => Duration_Image'Result'Length = Hour_Digits + 7 + Fraction_Digits;

Image representation of a Duration in the form HHHH:MM:SStttt

Seconds of type Duration

value to create the image from

Hour_Digits of type Positive

amount of digits for the hour to add.

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Duration_Wide_Image [source]

119 function Duration_Wide_Image
120 (Seconds : Duration;
121 Hour_Digits : Positive := 4;
122 Fraction_Digits : Natural := 1)
123 return Wide_String is
124 (Ada.Characters.Conversions.To_Wide_String (Duration_Image (Seconds, Hour_Digits, Fraction_Digits))) with
125 Pure_Function,
126 Inline,
127 Pre => Hour_Digits >= 2 and then Seconds <= 3_600.0 * (10**Hour_Digits),
128 Post => Duration_Wide_Image'Result'Length = Hour_Digits + 7 + Fraction_Digits;

Image representation of a Duration in the form HHHH:MM:SStttt

Seconds of type Duration

value to create the image from

Hour_Digits of type Positive

amount of digits for the hour to add.

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Duration_Wide_Wide_Image [source]

137 function Duration_Wide_Wide_Image
138 (Seconds : Duration;
139 Hour_Digits : Positive := 4;
140 Fraction_Digits : Natural := 1)
141 return Wide_Wide_String is
142 (Ada.Characters.Conversions.To_Wide_Wide_String (Duration_Image (Seconds, Hour_Digits, Fraction_Digits))) with
143 Pure_Function,
144 Inline,
145 Pre => Hour_Digits >= 2 and then Seconds <= 3_600.0 * (10**Hour_Digits),
146 Post => Duration_Wide_Wide_Image'Result'Length = Hour_Digits + 7 + Fraction_Digits;

Image representation of a Duration in the form HHHH:MM:SStttt

Seconds of type Duration

value to create the image from

Hour_Digits of type Positive

amount of digits for the hour to add.

Fraction_Digits of type Natural

amount of fractional digits to add.

Return value

Split_Duration [source]

34 procedure Split_Duration
35 (Seconds : Duration;
36 Hour : out Natural;
37 Minute : out Ada.Calendar.Formatting.Minute_Number;
38 Second : out Ada.Calendar.Formatting.Second_Number;
39 Sub_Second : out Ada.Calendar.Formatting.Second_Duration);
Seconds of type Duration
Hour of type Natural
Minute of type Minute_Number
Second of type Second_Number
Sub_Second of type Second_Duration

To_Second_Duration [source]

54 function To_Second_Duration
55 (Seconds : Ada.Calendar.Day_Duration) return Ada.Calendar.Formatting.Second_Duration with
56 Pure_Function;

Convert a Day_Duration into Second_Duration — which is basically the fraction part of the duration

Seconds of type Day_Duration

to convert

Return value

the Second_Duration of the duration

To_Second_Number [source]

46 function To_Second_Number (Seconds : Ada.Calendar.Day_Duration) return Ada.Calendar.Formatting.Second_Number with
47 Pure_Function;

Convert a Day_Duration into Second_Number — which is basically the integer part of the duration

Seconds of type Day_Duration

to convert

Return value

the Second_Number of the duration