From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to format this type of timestamp Date: Mon, 5 Oct 2020 12:05:40 +0300 Message-ID: <20201005090540.GD4453@protected.rcdrun.com> References: <20201003115510.GH32715@protected.rcdrun.com> <83pn5zfqik.fsf@gnu.org> <20201004042834.GJ32715@protected.rcdrun.com> <20201004074733.GA25970@tuxteam.de> <20201004140803.GB15516@protected.rcdrun.com> <20201004150117.GA9423@tuxteam.de> <20201004165940.GC15516@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23332"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.14.0 (2020-05-02) Cc: help-gnu-emacs To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 05 11:06:26 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPMRu-0005yX-IJ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Oct 2020 11:06:26 +0200 Original-Received: from localhost ([::1]:51292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPMRt-0001gK-KP for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Oct 2020 05:06:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPMRP-0001gA-GU for help-gnu-emacs@gnu.org; Mon, 05 Oct 2020 05:05:55 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:41593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPMRN-0004d3-12 for help-gnu-emacs@gnu.org; Mon, 05 Oct 2020 05:05:55 -0400 Original-Received: from localhost ([::ffff:197.157.34.178]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000005A103.000000005F7AE1E7.00006BF2; Mon, 05 Oct 2020 02:05:43 -0700 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/05 04:07:30 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124311 Archived-At: * Yuri Khan [2020-10-04 21:42]: > I think tomas’s remark was about the fact that you hardcode +03 in > your format string but you let Emacs auto-detect your local time zone. > This can cause an inconsistency if it detects a zone other than +03. > Two better options would be: > > a. Let Emacs auto-detect the time zone and use the %Z format specifier > to preserve the detected time zone in the string. > > (format-time-string "%F %T.%6N%Z" (/ 1599549641372 1000.0)) > ⇒ "2020-09-08 14:20:41.371999+07" Thank you. It is not good to hard code in my specific case, and also not good to assume the default local time zone as messages are coming from various countries in various time zones, it is not practical that I assume my local time zone, so I am waiting for the answer from developers of Silence SMS application, as maybe the time is UTC time, then it will be alright, then I can convert it properly to PostgreSQL timestamp with time zone. Thanks for directions.