Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
i want to remove timestamp form date field as shown in an image and convert it into proper date format ,how can i achieve this ??
The best way is to do this in the script:
load
...some fields...,
date(floor(UploadDate),'DD-MM-YYYY') as MyDate
from ...somewhere...;
Replace DD-MM-YYYY with the date format you really want.
edit: it looks like your timestamp is actually a string value. In that case try date#(left(UploadDate,11),'DD-MM-YYYY')
There seems to be a problem with the image, but you use the date# function to convert into a date and the date function to change the format.
Hope this helps
Write like
Date(Date#(UploadDate,'MMM DD YYYY hh:mmTT'),'DD/MM/YYYY')
The best way is to do this in the script:
load
...some fields...,
date(floor(UploadDate),'DD-MM-YYYY') as MyDate
from ...somewhere...;
Replace DD-MM-YYYY with the date format you really want.
edit: it looks like your timestamp is actually a string value. In that case try date#(left(UploadDate,11),'DD-MM-YYYY')
try Date(now(),'MMM DD YYYY')
Load like below script
LOAD *,Date(Date#(UploadDate,'MMM DD YYYY hh:mmTT'),'DD/MM/YYYY') as Newdate;
LOAD * Inline
[
UploadDate
Aug 16 2013 3:56PM
Dec 12 2013 6:08PM
Dec 24 2013 9:07PM
Dec 28 2013 5:24PM
];
Hi rohit,
use Date() and Date#()
Date(Date#(UploadDate,'MMM DD YYYY hh:mmTT'),'DD-MM-YYYY') as NewDate
Hai Frd This One Usuful For u...
SET DateFormat='DD/MMM/YYYY';
SET TimestampFormat='DD/MMM/YYYY hh:mm:ss[.fff]';
U May U Want See Only The Date Means
DATE([DateField],'$(DateFormat)') as NewFieldName,
O/P Like That
U May U Want See Only The Date & Timestamp Means
DATE([DateField],'$(TimestampFormat)') as NewFieldName,
O/P Like That
When using below script
LOAD *,Date(Date#(UploadDate,'MMM DD YYYY hh:mmTT'),'DD/MM/YYYY') as Newdate;
LOAD * Inline
[
UploadDate
Aug 16 2013 3:56PM
Dec 12 2013 6:08PM
Dec 24 2013 9:07PM
Dec 28 2013 5:24PM
];
You get change in date column like this
thanks anand ,but its only working for some dates for the rest its displaying null values