On Thursday, July 12, 2012 06:49:35 PM Dustin Parker wrote:
> Huh, the CS-W 2.0.2 spec doesn't mention time zones in their grammar,
> just 'Z'. Anyway, this code:
Hi Dustin, please have a look at section "6.2.2 OGC_Common catalogue query
language" (page 16)
The syntax rule is:
<UTC-time> ::= <time-hour> ":" <time-minute> ":" <time-second> "Z"
>
> private String extractTime(String cqlDateTime) {
> // splits dateTime to get the Time and time zone in the second array element
> String strUpper = cqlDateTime.toUpperCase();
> String[] dateTime = strUpper.split("T");
> assert dateTime.length >= 2 : "date and time is required by the sintax
> rule";
> // splits the time and time zone
> String[] time = dateTime[1].split("[+|-|Z]");
> return time[0]; // the time
> } Doesn't work because the regex is wrong; it should be "[-+Z]".
well "|" is the logical operator OR, so "-" or "+" or "Z" is required in the
split operation.
I had a look in the test cases, they cover this syntax. Some examples are:
Zulo zone: "2006-11-30T01:30:00Z"
local time: "2008-09-09T17:00:00"
time with offset: "2008-09-09T17:00:00+01:00"
Could you provide your test case to analyze?
>
> Thanks,
cheers
--
Mauricio Pazos
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel