houseabsolute / datetime-format-iso8601 Goto Github PK
View Code? Open in Web Editor NEWParses ISO8601 formats
Home Page: http://metacpan.org/release/DateTime-Format-ISO8601/
License: Other
Parses ISO8601 formats
Home Page: http://metacpan.org/release/DateTime-Format-ISO8601/
License: Other
Migrated from rt.cpan.org #104346 (status was 'open')
Requestors:
From [email protected] (@szabgab) on 2015-05-11 12:49:53
:
From the documentation it is unclear to me what "1991-W01" indicates but parsing "1991-W01" throws an exception while "1991-W02" parses.
The test suite fails on some of my smokers:
Can't locate object method "year_length" via package "DateTime" at /home/cpansand/.cpan/build/2020081520/DateTime-Format-ISO8601-0.13-0/blib/lib/DateTime/Format/ISO8601.pm line 1051, <DATA> line 1.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 after test #15.
# Seeded srand with seed '20200815' from local date.
t/base-datetime.t ......
Dubious, test returned 255 (wstat 65280, 0xff00)
All 15 subtests passed
... (etc) ...
Probably this happens if DateTime is too old:
****************************************************************
Regression 'mod:DateTime'
****************************************************************
Name Theta StdErr T-stat
[0='const'] 0.0000 0.0000 1.17
[1='eq_1.36'] 0.0000 0.0000 0.50
[2='eq_1.50'] 1.0000 0.0000 4697787031687232.00
[3='eq_1.51'] 1.0000 0.0000 5119294732350137.00
[4='eq_1.52'] 1.0000 0.0000 5197286303049295.00
R^2= 1.000, N= 74, K= 5
****************************************************************
Migrated from rt.cpan.org #74927 (status was 'new')
Requestors:
From [email protected] on 2012-02-13 13:13:02
:
File LICENSE quotes old FSF postal address. Current one can be found on
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. Please update
license wording to deliver correct address to your users.
Hi, I've met something strange.
At the SYNOPSIS,
use DateTime::Format::ISO8601;
my $str = '2020-07-25T11:32:31';
my $dt = DateTime::Format::ISO8601->parse_datetime($str);
$dt = DateTime::Format::ISO8601->parse_time($str);
...
when I run it within my test script, It says Invalid date format: 2020-07-25T11:32:31 ~
and dies at the end of lines.
It is strange.
And, I succeeded to pass this situation like this:
my $str = '2020-07-25T11:32:31';
say 'parse_datetime: ', my $dt = DateTime::Format::ISO8601->parse_datetime($str);
# parse_datetime: 2020-07-25T11:32:31 # correct
( undef, my $time ) = split 'T', $dt;
$time =~ s/://g;
say 'parse_time: ', $dt = DateTime::Format::ISO8601->parse_time($time);
# parse_time: 2020-10-12T11:32:31 # is it correct?
In DateTime, there is no definition for parse_time
.
And there is no document for parse_time
.
What does parse_time
mean?
Migrated from rt.cpan.org #131736 (status was 'new')
Requestors:
Attachments:
From [email protected] on 2020-02-11 05:04:36
:
Whilst dealing with the NVD JSON format, their ISO8601 format uses the 'YYYY-MM-DDThh:mmZ' format. Sadly, this module fails to recognize this.
Simple patch attached which fixes this.
Stuart
Migrated from rt.cpan.org #77535 (status was 'open')
Requestors:
Attachments:
From [email protected] on 2012-05-30 15:45:47
:
DateTime::Format::ISO8601, when parsing, allows a zero timezone offset
to be given with either sign:
$ perl -MDateTime::Format::ISO8601 -lwe 'print +DateTime::Format::ISO8601->parse_datetime("2000-01-01T12:00:00+00:00")'
2000-01-01T12:00:00
$ perl -MDateTime::Format::ISO8601 -lwe 'print +DateTime::Format::ISO8601->parse_datetime("2000-01-01T12:00:00-00:00")'
2000-01-01T12:00:00
ISO 8601 actually only allows "+" here, not "-". See the explanation
for the plus-or-minus sign in ISO 8601:2000 clause 5.1.1 or ISO 8601:2004
clause 3.4.2. The parsing function should reject "-" just as it rejects
"!".
-zefram
Migrated from rt.cpan.org #125660 (status was 'open')
Requestors:
From [email protected] on 2018-06-23 08:54:47
:
Meanwhile, I'll be releasing DateTime::Format::ISO8601::Format to supply this functionality, but I'm hoping it's in DateTime::Format::ISO8601
Migrated from rt.cpan.org #85258 (status was 'new')
Requestors:
From [email protected] on 2013-05-14 02:36:46
:
DateTime/Format/ISO8601.pm
115: implimentation -> implementation
Migrated from rt.cpan.org #53344 (status was 'open')
Requestors:
From [email protected] on 2010-01-04 16:48:10
:
Hi,
Due to the way _fix_1_digit_year is written, it sets the year incorrectly after
2010. I spotted this today when I noticed the tests failing (lines 231, 239,
247, and 254 in 02_examples.t).
As a suggestion, imo it would be better to add the parsed year instead of using
the regular expression and string concatenation.
Cheers,
Pedro
Migrated from rt.cpan.org #130682 (status was 'open')
Requestors:
From [email protected] (@domm) on 2019-10-09 19:15:48
:
Hi!
Is there any reason that there is support for
YYYY-MM-DDThh:mm:ss[+-]hh:mm
YYYY-MM-DDThh:mm:ss[+-]hh
YYYY-MM-DDThh:mm:ss.ss[+-]hh:mm
but NOT for
YYYY-MM-DDThh:mm:ss.ss[+-]hh
i.e. a string with miliseconds and only an hour offset is not parsable:
perl -MDateTime::Format::ISO8601 -E 'say DateTime::Format::ISO8601->parse_datetime("2019-10-09T21:07:10.42+02")'
PostgreSQLs now() functions returns strings with fractions of seconds and an hour only time-zone:
select now();
2019-10-09 21:10:21.14294+02
I guess it wouldn't be too hard to implement, and I would supply a patch, if this format would be supported...
Greetings,
domm
Migrated from rt.cpan.org #108082 (status was 'open')
Requestors:
From [email protected] on 2015-10-29 14:38:23
:
From Facebook's Graph API: "2011-04-30T10:00:00-0700" fails to parse in v0.08:
perl -MDateTime::Format::ISO8601 -le'print DateTime::Format::ISO8601->new()->parse_datetime("2011-04-30T10:00:00-0700")'
Invalid date format: 2011-04-30T10:00:00-0700 at -e line 1.
If I change "length" in this section:
{
#YYYYMMDDThhmmss[+-]hhmm 19850412T101530+0400
#YYYY-MM-DDThh:mm:ss[+-]hh:mm 1985-04-12T10:15:30+04:00
length => [ qw( 20 25 ) ],
regex => qr/^ (\d{4}) -?? (\d\d) -?? (\d\d)
T (\d\d) :?? (\d\d) :?? (\d\d) ([+-] \d\d :?? \d\d) $/x,
params => [ qw( year month day hour minute second time_zone ) ],
postprocess => \&_normalize_offset,
},
to:
length => [ qw( 20 24 25 ) ],
then it parses fine..
2020-07-24T24:00
is valid input for ISO-8601 < 2019 but is not accepted. You'll still find it generated in datalogging and billing applications.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.