You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Shin Chan <ha...@gmx.com> on 2012/04/20 08:09:22 UTC

UDF to find Week

Hi all my date is of the form

 YYYY-MM-DD HH:MM:SS.XXX

 How to find week for this ( 1-52 year week for given date) , any UDF for this ?

Thanks and Regards ,

Re: UDF to find Week

Posted by Dan Feldman <hr...@gmail.com>.
I highly doubt there are UDFs written for this sort of thing, but you could
figure out a week of the year with unix command (for example):

date -d '2012-04-13 11:43:03' '+%U'

if that helps. '+%U' gives you the week number (see
http://manpages.ubuntu.com/manpages/intrepid/man1/date.1.html)

Dan F.


On Thu, Apr 19, 2012 at 11:09 PM, Shin Chan <ha...@gmx.com> wrote:

> Hi all my date is of the form
>
>  YYYY-MM-DD HH:MM:SS.XXX
>
>  How to find week for this ( 1-52 year week for given date) , any UDF for
> this ?
>
> Thanks and Regards ,
>