Hi Shubham,
Do you need to store it in Date format instead of Long? You can store it as
Long and convert to ISO Date whenever you want. You can follow that:
org.apache.commons.lang.time.FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ss'Z'").format(date);
Kind Regards,
Furkan KAMACI
On Thu, Jan 12, 2017 at 1:50 PM, shubham.gupta <[email protected]>
wrote:
> Hey,
>
> When a webpage is parsed it stores the date in the dt_stamp in Long
> format. Whereas, I want to store it in ISODate Format. I have tried to
> change the type of java.lang.Long to java .util.Long and have changed while
> setting dtStamp and getting dtStamp.
>
> But after i build the project, these are the wrrors I get:
>
> GeneratorReducer.java:80: error: incompatible types: long cannot be
> converted to Date
> [javac] page.setDtStamp(1000L);
> [javac] ^
> InjectorJob.java:161: error: incompatible types: long cannot be
> converted to Date
> [javac] row.setDtStamp(curTime);
> [javac] ^
> FetcherReducer.java:682: error: incompatible types: long cannot be
> converted to Date
>
> [javac] fit.page.setDtStamp(2000L);
> [javac] ^
> [javac] Note: Some input files use unchecked or unsafe operations.
>
> What changes should be made such that I can enable the dt_stamp to be
> stored in Date Format?
>
> --
> Thanks and Regards,
> Shubham Gupta
>
>