unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: How to format this type of timestamp
Date: Mon, 5 Oct 2020 12:05:40 +0300	[thread overview]
Message-ID: <20201005090540.GD4453@protected.rcdrun.com> (raw)
In-Reply-To: <CAP_d_8Vc2b6JuAiutG+z=HdTUPLowu4QB+knV1uZLb-PE=LjFw@mail.gmail.com>

* Yuri Khan <yuri.v.khan@gmail.com> [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.



  parent reply	other threads:[~2020-10-05  9:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 11:55 How to format this type of timestamp Jean Louis
2020-10-03 12:22 ` Eli Zaretskii
2020-10-04  4:28   ` Jean Louis
2020-10-04  7:32     ` Eli Zaretskii
2020-10-04  7:47     ` tomas
2020-10-04 14:08       ` Jean Louis
2020-10-04 15:01         ` tomas
2020-10-04 16:59           ` Jean Louis
2020-10-04 18:41             ` Yuri Khan
2020-10-04 19:26               ` tomas
2020-10-05  9:05               ` Jean Louis [this message]
2020-10-05 10:34                 ` tomas
2020-10-05 12:46                   ` Tim Visher
2020-10-05 13:10                     ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201005090540.GD4453@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).