Reputation: 2375
I am converting a date string to datetime format in Pig using Todate function, but it is spitting out the wrong month.
input date = "2014-04-15 01:25:33.583Z" I am loading this as chararray
usage: ToDate(Timestamp,'YYYY-MM-DD HH:mm:ss.SSS')
output : 2014-01-15T01:25:33.583Z
Any idea as to why this could be happening.
Upvotes: 1
Views: 3646
Reputation: 21
ToDate(Timestamp,'yyyy-MM-dd HH:mm:ss.SSS')
Upvotes: 0
Reputation: 4838
The issues lies on the string format : the YYYY and DD should be in lowercase, while the months should stay in uppercase !
cf : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
Upvotes: 2