Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Hyukjin Kwon
Hi all,


I am trying to replace 'ZZ' time format to 'XXX' format to resolve an issue
in Apache Spark.

I looked at the codes related with this as below:

https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L930

https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L932-L951

https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L596-L601

Up to my tests and reading codes, it seems both are identical to me.

Is this true and would this be identical in the future too?

Or maybe is 'ZZ' going to be deprecated soon?

I appreciate if anyone could confirm this please.


Thank you in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Charles Honton
The javadoc for FastDatePrinter states:
"Starting with JDK7, ISO 8601 support was added using the pattern 'X'. To maintain compatibility, 'ZZ'will continue to be supported, but using one of the 'X' formats is recommended."

Chas

> On Mar 31, 2017, at 5:38 AM, Hyukjin Kwon <[hidden email]> wrote:
>
> Hi all,
>
>
> I am trying to replace 'ZZ' time format to 'XXX' format to resolve an issue
> in Apache Spark.
>
> I looked at the codes related with this as below:
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L930
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L932-L951
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/lang3/time/FastDateParser.java#L596-L601
>
> Up to my tests and reading codes, it seems both are identical to me.
>
> Is this true and would this be identical in the future too?
>
> Or maybe is 'ZZ' going to be deprecated soon?
>
> I appreciate if anyone could confirm this please.
>
>
> Thank you in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Hyukjin Kwon
Thanks for your answer, Chas.

I understood ISO 8601 is supportrd by both 'X' and 'ZZ'.

Do you maybe know if they are the same and interchangable?

I am worried of any regression after replacing 'ZZ' to 'X'. I read the
codes and checked they are same at my best but I wonder if I missed
anything and want to be sure.

Thanks.


On 31 Mar 2017 10:31 p.m., "Chas Honton" <[hidden email]> wrote:

The javadoc for FastDatePrinter states:
"Starting with JDK7, ISO 8601 support was added using the pattern 'X'. To
maintain compatibility, 'ZZ'will continue to be supported, but using one of
the 'X' formats is recommended."

Chas

> On Mar 31, 2017, at 5:38 AM, Hyukjin Kwon <[hidden email]> wrote:
>
> Hi all,
>
>
> I am trying to replace 'ZZ' time format to 'XXX' format to resolve an
issue
> in Apache Spark.
>
> I looked at the codes related with this as below:
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8
e574be7e5e/src/main/java/org/apache/commons/lang3/time/
FastDateParser.java#L930
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8
e574be7e5e/src/main/java/org/apache/commons/lang3/time/
FastDateParser.java#L932-L951
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af07093c1e6c422dae8
e574be7e5e/src/main/java/org/apache/commons/lang3/time/
FastDateParser.java#L596-L601

>
> Up to my tests and reading codes, it seems both are identical to me.
>
> Is this true and would this be identical in the future too?
>
> Or maybe is 'ZZ' going to be deprecated soon?
>
> I appreciate if anyone could confirm this please.
>
>
> Thank you in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Hyukjin Kwon
Oh, I meant 'ZZ' vs 'XXX' not 'X'.

On 1 Apr 2017 11:05 a.m., "Hyukjin Kwon" <[hidden email]> wrote:

Thanks for your answer, Chas.

I understood ISO 8601 is supportrd by both 'X' and 'ZZ'.

Do you maybe know if they are the same and interchangable?

I am worried of any regression after replacing 'ZZ' to 'X'. I read the
codes and checked they are same at my best but I wonder if I missed
anything and want to be sure.

Thanks.


On 31 Mar 2017 10:31 p.m., "Chas Honton" <[hidden email]> wrote:

The javadoc for FastDatePrinter states:
"Starting with JDK7, ISO 8601 support was added using the pattern 'X'. To
maintain compatibility, 'ZZ'will continue to be supported, but using one of
the 'X' formats is recommended."

Chas

> On Mar 31, 2017, at 5:38 AM, Hyukjin Kwon <[hidden email]> wrote:
>
> Hi all,
>
>
> I am trying to replace 'ZZ' time format to 'XXX' format to resolve an
issue
> in Apache Spark.
>
> I looked at the codes related with this as below:
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
lang3/time/FastDateParser.java#L930
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
lang3/time/FastDateParser.java#L932-L951
>
> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
lang3/time/FastDateParser.java#L596-L601

>
> Up to my tests and reading codes, it seems both are identical to me.
>
> Is this true and would this be identical in the future too?
>
> Or maybe is 'ZZ' going to be deprecated soon?
>
> I appreciate if anyone could confirm this please.
>
>
> Thank you in advance.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Charles Honton
For both FastDateParser and FastDatePrinter, Z is equivalent to SimpleDateFormat Z.
For both FastDateParser and FastDatePrinter, ZZ is equivalent to SimpleDateFormat XXX.

For FastDateParser, ZZZ is equivalent to SimpleDateFormat z.
For FastDatePrinter, ZZZ is mostly equivalent to SimpleDateFormat XXX (UTC is displayed as '+00:00'instead of 'Z').

SimpleDateFormat does not support ‘ZZ’ as ISO8601.  Whether it is an invalid format of  is not Historically ZZ was introduced in the FastDatePrinter to support ISO8601 before the X format was added to SimpleDateFormat in JRE1.7.

For SimpleDateFormat Z, ZZ, and ZZZ are equivalent.

Bottom Line: Use one of the X formats to make sure you are compatible with JRE classes.

chas

> On Mar 31, 2017, at 7:06 PM, Hyukjin Kwon <[hidden email]> wrote:
>
> Oh, I meant 'ZZ' vs 'XXX' not 'X'.
>
> On 1 Apr 2017 11:05 a.m., "Hyukjin Kwon" <[hidden email]> wrote:
>
> Thanks for your answer, Chas.
>
> I understood ISO 8601 is supportrd by both 'X' and 'ZZ'.
>
> Do you maybe know if they are the same and interchangable?
>
> I am worried of any regression after replacing 'ZZ' to 'X'. I read the
> codes and checked they are same at my best but I wonder if I missed
> anything and want to be sure.
>
> Thanks.
>
>
> On 31 Mar 2017 10:31 p.m., "Chas Honton" <[hidden email]> wrote:
>
> The javadoc for FastDatePrinter states:
> "Starting with JDK7, ISO 8601 support was added using the pattern 'X'. To
> maintain compatibility, 'ZZ'will continue to be supported, but using one of
> the 'X' formats is recommended."
>
> Chas
>
>> On Mar 31, 2017, at 5:38 AM, Hyukjin Kwon <[hidden email]> wrote:
>>
>> Hi all,
>>
>>
>> I am trying to replace 'ZZ' time format to 'XXX' format to resolve an
> issue
>> in Apache Spark.
>>
>> I looked at the codes related with this as below:
>>
>> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> lang3/time/FastDateParser.java#L930
>>
>> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> lang3/time/FastDateParser.java#L932-L951
>>
>> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> lang3/time/FastDateParser.java#L596-L601
>>
>> Up to my tests and reading codes, it seems both are identical to me.
>>
>> Is this true and would this be identical in the future too?
>>
>> Or maybe is 'ZZ' going to be deprecated soon?
>>
>> I appreciate if anyone could confirm this please.
>>
>>
>> Thank you in advance.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Confusion between 'ZZ' and 'XXX' timezone formats in FastDateFormat

Hyukjin Kwon
Thank you so much.

On 1 Apr 2017 12:10 p.m., "Charles Honton" <[hidden email]> wrote:

> For both FastDateParser and FastDatePrinter, Z is equivalent to
> SimpleDateFormat Z.
> For both FastDateParser and FastDatePrinter, ZZ is equivalent to
> SimpleDateFormat XXX.
>
> For FastDateParser, ZZZ is equivalent to SimpleDateFormat z.
> For FastDatePrinter, ZZZ is mostly equivalent to SimpleDateFormat XXX (UTC
> is displayed as '+00:00'instead of 'Z').
>
> SimpleDateFormat does not support ‘ZZ’ as ISO8601.  Whether it is an
> invalid format of  is not Historically ZZ was introduced in the
> FastDatePrinter to support ISO8601 before the X format was added to
> SimpleDateFormat in JRE1.7.
>
> For SimpleDateFormat Z, ZZ, and ZZZ are equivalent.
>
> Bottom Line: Use one of the X formats to make sure you are compatible with
> JRE classes.
>
> chas
>
> > On Mar 31, 2017, at 7:06 PM, Hyukjin Kwon <[hidden email]> wrote:
> >
> > Oh, I meant 'ZZ' vs 'XXX' not 'X'.
> >
> > On 1 Apr 2017 11:05 a.m., "Hyukjin Kwon" <[hidden email]> wrote:
> >
> > Thanks for your answer, Chas.
> >
> > I understood ISO 8601 is supportrd by both 'X' and 'ZZ'.
> >
> > Do you maybe know if they are the same and interchangable?
> >
> > I am worried of any regression after replacing 'ZZ' to 'X'. I read the
> > codes and checked they are same at my best but I wonder if I missed
> > anything and want to be sure.
> >
> > Thanks.
> >
> >
> > On 31 Mar 2017 10:31 p.m., "Chas Honton" <[hidden email]> wrote:
> >
> > The javadoc for FastDatePrinter states:
> > "Starting with JDK7, ISO 8601 support was added using the pattern 'X'. To
> > maintain compatibility, 'ZZ'will continue to be supported, but using one
> of
> > the 'X' formats is recommended."
> >
> > Chas
> >
> >> On Mar 31, 2017, at 5:38 AM, Hyukjin Kwon <[hidden email]> wrote:
> >>
> >> Hi all,
> >>
> >>
> >> I am trying to replace 'ZZ' time format to 'XXX' format to resolve an
> > issue
> >> in Apache Spark.
> >>
> >> I looked at the codes related with this as below:
> >>
> >> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> > 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> > lang3/time/FastDateParser.java#L930
> >>
> >> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> > 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> > lang3/time/FastDateParser.java#L932-L951
> >>
> >> https://github.com/apache/commons-lang/blob/8767cd4f1a6af070
> > 93c1e6c422dae8e574be7e5e/src/main/java/org/apache/commons/
> > lang3/time/FastDateParser.java#L596-L601
> >>
> >> Up to my tests and reading codes, it seems both are identical to me.
> >>
> >> Is this true and would this be identical in the future too?
> >>
> >> Or maybe is 'ZZ' going to be deprecated soon?
> >>
> >> I appreciate if anyone could confirm this please.
> >>
> >>
> >> Thank you in advance.
>
>
Loading...