You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by vikas Madhusudana <vi...@gmail.com> on 2016/05/17 11:02:06 UTC
ToDate does not parse the date properly
Hi,
I have a date string "2016-05-11 23:59:57.628"
I am using ToDate to parse the date ToDate($0, "YYYY-MM-DD HH:mm:ss.SSS);
It is parsing the date as 2016-01-11T23:59:57.628-08:00
Month is parsed as 01 (Jan instead of May).
Am i missing something here?
Thanks,
Vikas
Re: ToDate does not parse the date properly
Posted by vikas Madhusudana <vi...@gmail.com>.
Thanks. Its working fine now.
Thanks,
Vikas
On Sat, May 28, 2016 at 3:10 AM, Rohini Palaniswamy <rohini.aditya@gmail.com
> wrote:
> http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
>
> You need to use 'YYYY-MM-dd HH:mm:ss.SSS' instead of 'YYYY-MM-DD
> HH:mm:ss.SSS'. DD stands for day of the year and dd stands for day of the
> month. 11th day of the year can only be in January. So month always comes
> out as January.
>
>
>
> On Tue, May 17, 2016 at 4:02 AM, vikas Madhusudana <vi...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I have a date string "2016-05-11 23:59:57.628"
> >
> > I am using ToDate to parse the date ToDate($0, "YYYY-MM-DD HH:mm:ss.SSS);
> >
> > It is parsing the date as 2016-01-11T23:59:57.628-08:00
> >
> > Month is parsed as 01 (Jan instead of May).
> >
> > Am i missing something here?
> >
> > Thanks,
> > Vikas
> >
>
Re: ToDate does not parse the date properly
Posted by Rohini Palaniswamy <ro...@gmail.com>.
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
You need to use 'YYYY-MM-dd HH:mm:ss.SSS' instead of 'YYYY-MM-DD
HH:mm:ss.SSS'. DD stands for day of the year and dd stands for day of the
month. 11th day of the year can only be in January. So month always comes
out as January.
On Tue, May 17, 2016 at 4:02 AM, vikas Madhusudana <vi...@gmail.com>
wrote:
> Hi,
>
> I have a date string "2016-05-11 23:59:57.628"
>
> I am using ToDate to parse the date ToDate($0, "YYYY-MM-DD HH:mm:ss.SSS);
>
> It is parsing the date as 2016-01-11T23:59:57.628-08:00
>
> Month is parsed as 01 (Jan instead of May).
>
> Am i missing something here?
>
> Thanks,
> Vikas
>