Overview
Comment: | time_io-rfc_3339: add extra arguments to work around implementations without leap second support |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
21534f262f497758fa31d0c337963132 |
User & Date: | nat on 2014-08-20 19:49:24 |
Other Links: | manifest | tags |
Context
2014-08-21
| ||
20:52 | time_io-tests: add test for leap second workaround on implementations that don't support them check-in: ba34be19be user: nat tags: trunk | |
2014-08-20
| ||
19:49 | time_io-rfc_3339: add extra arguments to work around implementations without leap second support check-in: 21534f262f user: nat tags: trunk | |
2014-08-19
| ||
21:09 | time_io-tests: check leap second support before using it in tests check-in: 03c5f8582b user: nat tags: trunk | |
Changes
Modified src/natools-time_io-rfc_3339.adb from [254f3dab5b] to [aba9d550db].
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | - + + - + + - + + | -------------------- -- Time To String -- -------------------- function Image (Date : Ada.Calendar.Time; |
︙ | |||
176 177 178 179 180 181 182 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | - + | (Date, Year, Month, Day, Hour, Minute, Second, Subsecond, Leap_Second, Time_Zone); |
︙ | |||
227 228 229 230 231 232 233 234 235 236 237 238 239 240 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | + + + + + + + + + + + + - + | procedure Value (Image : in String; Date : out Ada.Calendar.Time; Time_Zone : out Ada.Calendar.Time_Zones.Time_Offset) is Discarded : Boolean; begin Value (Image, Date, Time_Zone, Discarded); end Value; procedure Value (Image : in String; Date : out Ada.Calendar.Time; Time_Zone : out Ada.Calendar.Time_Zones.Time_Offset; Leap_Second : out Boolean) is Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number; Hour : Ada.Calendar.Formatting.Hour_Number; Minute : Ada.Calendar.Formatting.Minute_Number; Second : Ada.Calendar.Formatting.Second_Number; Subsecond : Ada.Calendar.Formatting.Second_Duration := 0.0; |
︙ | |||
285 286 287 288 289 290 291 292 293 294 295 | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | + + + + + + + + + + + + + - + | when '+' => null; when others => raise Constraint_Error with "Invalid time zone separator in RFC 3339 date"; end case; end if; if Leap_Second then begin Date := Ada.Calendar.Formatting.Time_Of (Year, Month, Day, Hour, Minute, Second, Subsecond, True, Time_Zone); return; exception when Ada.Calendar.Time_Error => null; end; end if; Date := Ada.Calendar.Formatting.Time_Of (Year, Month, Day, Hour, Minute, Second, |
Modified src/natools-time_io-rfc_3339.ads from [25471d80ad] to [d3cf5765f6].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - + + - + + + + + + + + + + | Subsecond_Separator : constant Character := '.'; function Is_Valid (Image : String) return Boolean; -- Check whether Image is a valid RFC-3339 date function Image (Date : Ada.Calendar.Time; |