From owner-freebsd-questions@FreeBSD.ORG Sun Nov 28 18:37:52 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B800816A4CE for ; Sun, 28 Nov 2004 18:37:52 +0000 (GMT) Received: from s42.loopia.se (s42.loopia.se [194.9.94.4]) by mx1.FreeBSD.org (Postfix) with SMTP id B083043D39 for ; Sun, 28 Nov 2004 18:37:51 +0000 (GMT) (envelope-from jimmy@loopia.se) Received: (qmail 49881 invoked from network); 28 Nov 2004 18:37:55 -0000 Received: from s27.loopia.se (194.9.95.3) by s42.loopia.se with SMTP; 28 Nov 2004 18:37:55 -0000 Received: from s27.loopia.se (localhost [127.0.0.1]) by s27.loopia.se (8.12.9p2/8.12.9) with ESMTP id iASIbl0V085239; Sun, 28 Nov 2004 19:37:47 +0100 (CET) (envelope-from jimmy@loopia.se) Received: (from www@localhost) by s27.loopia.se (8.12.9p2/8.12.9/Submit) id iASIblVF085238; Sun, 28 Nov 2004 19:37:47 +0100 (CET) (envelope-from jimmy@loopia.se) X-Authentication-Warning: s27.loopia.se: www set sender to jimmy@loopia.se using -f Received: from me-0-9-5b-c4-a6-b.2.cust.bredband2.com (me-0-9-5b-c4-a6-b.2.cust.bredband2.com [82.209.148.245]) by webbmail.loopia.se (IMP) with HTTP for ; Sun, 28 Nov 2004 19:37:47 +0100 Message-ID: <1101667067.41aa1afb03304@webbmail.loopia.se> Date: Sun, 28 Nov 2004 19:37:47 +0100 From: jimmy@loopia.se To: aeder@list.ru References: <045701c4d543$2ff2c160$c600a8c0@i11> <41AA14D4.608@list.ru> In-Reply-To: <41AA14D4.608@list.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.2 / FreeBSD-4.9 X-Originating-IP: 82.209.148.245 cc: freebsd-questions@freebsd.org Subject: Re: Timezone conversion X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2004 18:37:52 -0000 Quoting : > Try the following: > 1. Output date in seconds from epoch > SECONDS=$(date ... "+%s") > 2. Change the time zone. > TZ=CET > export TZ > date -r $SECONDS Yes, but I have dates in the format specified in the earlier mail (with a different timezone-offset) and want to convert them to the current timezone. The first step was just to get an example. So 28 Nov 2004 12:02:18 +0000 in the example is not the current time, it is a time which I got from an external source (and I can not assume that the date is in UTC). For your example to work the "..." would still have to include %z in its format-string, and this doesn't seem to work (if I'm not doing something stupid, if so please tell me). Thanks for your response anyway. Any more takers? Best regards, Jimmy Mäkelä