X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=qig BeFaGCYmuZ/BpjH6H7bel0SgGfW7lw3Hqrk4poZk29vE2N7DuYhPPnA8TV2oqpAk W/erWttbzYYZ/csMrR9iqL6ajq2IamYdb5OuScLNbMla9ia1OkM4nAR+iJZ6Sen9 /rYaFvrhyEfdG6MWMbxo1ScKwxBZ7kjZ5oSqB3s8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=dc9WdUCr3 JiH93Zk02V0jI9YYVA=; b=oO6wBfiCTpELlbJJFgCaXaZ8Qu2FQrLg5NI6FnQPb T4j5h+I0pwgqtvhxtNfa7G4dcbMs2eX+za0Uo2zh4AJYLKaou7j2DTe+czoCowVA bZIfJTexFAIxEqfcOKuoTSQqpjrimxFsGS97zFuiNwNXtxZvHNChnqffEeq6butk 8U= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Brian Inglis Subject: Re: Bash unable to print epoch timestamp Date: Thu, 22 Oct 2015 00:05:53 +0000 (UTC) Lines: 15 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Don Harrop effx.us> writes: > Bash outputs no value when using it's built in method of printing an > "epoch" timestamp. > BashCommandLine#: printf '%(%s)T' -1 bash printf depends on underlying strftime in newlib, which does not support %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and that is presumably not defined in the config, as %s is not shown in man strftime. Workaround for now is use date +%s for current time, and date -d $(printf '%(%T)T' -2) +%s for shell invocation time. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple