Recent

Author Topic: DateUtils TryISO8601ToDate  (Read 773 times)

Hobbit1972

  • New Member
  • *
  • Posts: 25
DateUtils TryISO8601ToDate
« on: April 30, 2022, 02:38:17 pm »
Hi,

I'm procesing some output of a website. It contains ISO8601 date&time. Using TryISO8601ToStr from DateUtils I stumbled over the following:

Code: Pascal  [Select][+][-]
  1. TryIso8601ToDate('2022-01-10T21:00:00.0Z',datevar);

fails - if I remove the millisecond part it's fine. According to spec ISO8601 allows milliseconds.

Do I overlook something? Tx



P.S: Changed tile from ..ToStr to ..ToDate  >:(
« Last Edit: April 30, 2022, 02:42:51 pm by Hobbit1972 »

wp

  • Hero Member
  • *****
  • Posts: 13210
Re: DateUtils TryISO8601ToDate
« Reply #1 on: April 30, 2022, 02:54:11 pm »
FPC 3.2.2 and older have issues with that - see https://gitlab.com/freepascal.org/fpc/source/-/issues/38968. Fixed in FPC/main and fixes.

Hobbit1972

  • New Member
  • *
  • Posts: 25
Re: DateUtils TryISO8601ToDate
« Reply #2 on: April 30, 2022, 02:57:42 pm »
Ah - tyvm

 

TinyPortal © 2005-2018