Return-Path: X-Original-To: apmail-hive-user-archive@www.apache.org Delivered-To: apmail-hive-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C8C52729B for ; Thu, 1 Dec 2011 18:29:25 +0000 (UTC) Received: (qmail 6802 invoked by uid 500); 1 Dec 2011 18:29:25 -0000 Delivered-To: apmail-hive-user-archive@hive.apache.org Received: (qmail 6757 invoked by uid 500); 1 Dec 2011 18:29:24 -0000 Mailing-List: contact user-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hive.apache.org Delivered-To: mailing list user@hive.apache.org Received: (qmail 6747 invoked by uid 99); 1 Dec 2011 18:29:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 18:29:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of manu.infy@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ey0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Dec 2011 18:29:18 +0000 Received: by eaal12 with SMTP id l12so3408601eaa.35 for ; Thu, 01 Dec 2011 10:28:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=6W0z/GMlZM3O0LeDCj8oPSpAv8uHEc3PUt9N9SPvSoA=; b=HT6STDUEALHQ7k2xK/AveEz1uTJ3UwWADlLdFCjlebHLG9qL4HWg4la7rhmo6K2Joh tUGK8RkVz+NCGcFCwnIynHkQThT0KYKQ3ZEs8GOBwXaidhKOxjQqlq0tEXzxNlZewYpK WRe1+4w4m9gqpHp4/4FDLikbyHy795KpDME0I= Received: by 10.216.14.37 with SMTP id c37mr519505wec.86.1322764137244; Thu, 01 Dec 2011 10:28:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.101.202 with HTTP; Thu, 1 Dec 2011 10:28:36 -0800 (PST) In-Reply-To: References: From: Abhishek Pratap Singh Date: Thu, 1 Dec 2011 10:28:36 -0800 Message-ID: Subject: Re: Convert UTC timestamp to PST To: user@hive.apache.org Content-Type: multipart/alternative; boundary=001485f775fc85a69d04b30c0611 --001485f775fc85a69d04b30c0611 Content-Type: text/plain; charset=ISO-8859-1 hi Sonia, Try this SELECT from_unixtime((unix_timestamp(TXN_DATE) - 28800), 'yyyy-MM-dd HH:MM:SS') as TXNDATE 28800 is the 8 hours difference in seconds for PDT. ~Abhishek On Thu, Dec 1, 2011 at 10:21 AM, sonia gehlot wrote: > Hi All, > > I have Unix timestamp in my table in UTC format. Is there is any inbuilt > function to convert it into PST or PDT in YYYY-MM-DD HH:MM:SS format? I > know there are functions like from_unixtime to convert unixtime to date > format, but I am not sure how to convert it to PST. > > Thanks in advance, > > Sonia > --001485f775fc85a69d04b30c0611 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
hi Sonia,


Try this

SELECT from_unixtime((unix_timestamp(TXN_DATE) - 28800), = 9;yyyy-MM-dd HH:MM:SS') as TXNDATE

28800 is the 8 hours difference in seconds for PDT.=A0
<= div>

~Abhishek
=
On Thu, Dec 1, 2011 at 10:21 AM, sonia gehlot <sonia.gehlot@gmail.com> wr= ote:
Hi All,

I have Unix timestamp in my table in UTC format. Is there is= any inbuilt function to convert it into PST or PDT in YYYY-MM-DD HH:MM:SS = format? I know there are functions like from_unixtime to convert unixtime t= o date format, but I am not sure how to convert it to PST.

Thanks in advance,

Sonia

--001485f775fc85a69d04b30c0611--