Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 42059200B27 for ; Wed, 8 Jun 2016 07:44:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 40C13160A36; Wed, 8 Jun 2016 05:44:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 881C3160A4F for ; Wed, 8 Jun 2016 07:44:24 +0200 (CEST) Received: (qmail 665 invoked by uid 500); 8 Jun 2016 05:44:23 -0000 Mailing-List: contact dev-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list dev@asterixdb.apache.org Received: (qmail 645 invoked by uid 99); 8 Jun 2016 05:44:23 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2016 05:44:23 +0000 Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com [209.85.161.171]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 476341A015B for ; Wed, 8 Jun 2016 05:44:23 +0000 (UTC) Received: by mail-yw0-f171.google.com with SMTP id x189so190769791ywe.3 for ; Tue, 07 Jun 2016 22:44:23 -0700 (PDT) X-Gm-Message-State: ALyK8tLqt/I2EtATlt22XNcSOLPzkUD6uqg2GFxka3S8XZBVCbnLdbm2Mu/ebGlwPrkqRGnaq2kASIfueCDavQ== X-Received: by 10.13.234.213 with SMTP id t204mr1619416ywe.268.1465364662264; Tue, 07 Jun 2016 22:44:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.108.136 with HTTP; Tue, 7 Jun 2016 22:44:21 -0700 (PDT) In-Reply-To: References: From: Preston Carman Date: Tue, 7 Jun 2016 22:44:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Datetime to Unix Timestamp To: dev@asterixdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Wed, 08 Jun 2016 05:44:25 -0000 It would be nice to be able to get the numeric value used to store the different time units. It seems that UNIX timestamp only refers to datetime in seconds. Although the datetime format in AsterixDB is stores a datetime in milliseconds. We could come up with a better function name. These are the ones I am using in the current patch. UNIX_TIME_FROM_DATE_IN_DAYS UNIX_TIME_FROM_DATETIME_IN_SECS UNIX_TIME_FROM_DATETIME_IN_MS UNIX_TIME_FROM_TIME_IN_SECS On Tue, Jun 7, 2016 at 5:23 AM, Till Westmann wrote: > I think that it=E2=80=99s fine to add a function for this. However, AFAIK= the UNIX > timestamp is in seconds [1], so it seems that we don=E2=80=99t need funct= ions for > different time units. > > Is there a reason why we should support different time units? > > Cheers, > Till > > [1] https://en.wikipedia.org/wiki/Unix_time > > On 6 Jun 2016, at 3:08, Ian Maxon wrote: > >> I don't think so. The other way around (timestamp to datetime) only exis= ted >> until relatively recently. I never made the other way around, or at leas= t I >> don't recall doing it. >> >> On Sun, Jun 5, 2016 at 3:03 PM, Preston Carman wro= te: >> >>> Is there a way to get the Unix timestamp of a datetime value? The data >>> is stored in this way. We have several functions to take a UNIX >>> timestamp and create an AsterixDB datetime value, but do we have the >>> other way around? >>> >>> Possible functions >>> UNIX_TIME_FROM_DATETIME_IN_MS >>> UNIX_TIME_FROM_DATETIME_IN_SECS >>> >>> Thoughts on adding these functions? >>> >>> Just wanted to check to see if I was missing the way method to get a >>> Unix timestamp or it was actually missing. >>> >>> Thanks >>> Preston >>>