Well, I can not use to_date function since it expects a string input while I have a timestamp. Also doing is in java is not a solution since I want to do a group by on the timestamp in a customized timezone.
On Tue, Feb 25, 2014 at 11:25 AM, James Taylor <[email protected]>wrote: > Have you tried using the TO_DATE in conjunction with the TO_CHAR, where > you specify a different timezone in the TO_DATE format_arg? > > Another option is to do this in Java. When you do a > resultSet.getDate("MY_DATE_COL"), you can do whatever you want with the > Date you get back. > > We're definitely open to taking contributions for new built-in functions. > They're pretty easy to add. Just follow this guide: > http://phoenix-hbase.blogspot.com/2013/04/how-to-add-your-own-built-in-function.html > > Adding more date manipulation functions would be much appreciated. > > Thanks, > James > > > On Tue, Feb 25, 2014 at 11:16 AM, Sean Huo <[email protected]> wrote: > >> Well, to be frankly, the example on the to_char udf is wrong >> >> TO_CHAR(myDate, '2001-02-03 04:05:06') >> does not produce the right result and is misleading. >> >> This function does not give one the ability to format the date in a >> customized timezone. >> ALl it does is to allow timezone to be included in the output, but it is >> is always GMT. >> >> >> >> >> On Tue, Feb 25, 2014 at 11:04 AM, James Taylor <[email protected]>wrote: >> >>> http://phoenix.incubator.apache.org/language/functions.html#/to_charwith a >>> formatString argument. >>> >>> >>> On Tue, Feb 25, 2014 at 10:58 AM, Sean Huo <[email protected]> wrote: >>> >>>> It seems that to_char udf always produces timestamp/date string in GMT. >>>> Is there a function that allows users to pass in a timezone string so >>>> that timestamp can be displayed accordingly? >>>> >>>> Thanks >>>> >>>> Sean >>>> >>> >>> >> >
