~protesilaos/denote

7 5

denote-change-file-type does not take time from identifier

Details
Message ID
<CADS3Lq5Z4Bpx9W+j7s831eJihDC7tL-jYmj65DEyUp4UU=y1yg@mail.gmail.com>
DKIM signature
missing
Download raw message
I am renaming a file by changing only its file type (.txt to .org) with M-x
denote-change-file-type.  The change was successful with the following front
matter prepended to the top of the file.  I show the original front matter as
well.

#+title:      Public vs Private IP Addresses
#+date:       [2023-09-16 Sat 19:28]
#+filetags:   :networking:
#+identifier: 20230916T172802

title:      Public vs Private IP Addresses
date:       2023-09-16
tags:       networking
identifier: 20230916T172802
---------------------------

I note in the Org front matter the date includes the time.  However, notice
this time does not match the time in the identifier.  Where does denote take
this time value or is it a bug that it should match that in the identifier?

Thanks for your time and denote.
Details
Message ID
<8634z7erog.fsf@nobiot.com>
In-Reply-To
<CADS3Lq5Z4Bpx9W+j7s831eJihDC7tL-jYmj65DEyUp4UU=y1yg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> I note in the Org front matter the date includes the time. However,
> notice this time does not match the time in the identifier.

Hi Niall, I suspect this is related to the difference between your local
time zone and UTC. You happen to have created your note in the UTC+2
time zone, perhaps?

--nobiot
Details
Message ID
<CADS3Lq6H5pc1hFvXSLL_23bOE4eudz=BGOK91_0uE5D3QDaZCw@mail.gmail.com>
In-Reply-To
<8634z7erog.fsf@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
On Thu, 21 Sept 2023 at 12:39, nobiot <me@nobiot.com> wrote:
> I suspect this is related to the difference between your local
> time zone and UTC. You happen to have created your note in the UTC+2
> time zone, perhaps?

Ah, I see.  Yes, I'm in UTC+2.  Thanks for the explanation.
Details
Message ID
<861qerb4li.fsf@nobiot.com>
In-Reply-To
<CADS3Lq5Z4Bpx9W+j7s831eJihDC7tL-jYmj65DEyUp4UU=y1yg@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hi Niall,

I was trying to verify my suspicion about the influence of time zone. I
think I was mistaken.

> #+title:      Public vs Private IP Addresses
> #+date:       [2023-09-16 Sat 19:28]
> #+filetags:   :networking:
> #+identifier: 20230916T172802

The command `denote-change-file-type` calls `denote--add-front-matter'
to add a new front matter. The new frontmatter determines the new `date` from
the identifier in the _file name_.

For org files, the Emacs local time is used... That is, Denote uses
function `format-time-string` for org file type without passing the ZONE
argument).

So the only explanation I can think of is that your file name starts has
the time 19:28, different to the identifier property 17:28 in the
front matter.

What is the file name of this file?


– nobiot
Details
Message ID
<874jjmxu6j.fsf@protesilaos.com>
In-Reply-To
<861qerb4li.fsf@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
> From: nobiot <me@nobiot.com>
> Date: Thu, 21 Sep 2023 23:26:17 +0200
>
> Hi Niall,

Hello Niall, nobiot,

>  I note in the Org front matter the date includes the time.  However, notice
>  this time does not match the time in the identifier.  Where does denote take
>  this time value or is it a bug that it should match that in the identifier?

I have the same question as nobiot: it seems the identifier in the file
name is different.  Denote should take the value from there.

> [... 12 lines elided]

> For org files, the Emacs local time is used... That is, Denote uses
> function `format-time-string` for org file type without passing the ZONE
> argument).

Indeed, we do not use this.  I wonder if that is a problem though.
Perhaps we should default to UTC?

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<0C399C47-969C-4B40-8B54-1A131C21072B@nobiot.com>
In-Reply-To
<874jjmxu6j.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
> Perhaps we should default to UTC?

Independent of this issue, personally I prefer
the way it is now: local time everywhere. It sort
of captures the moment of the time I
experience—even if I was jet-lagged by flying
from Paris to Tokyo, as an example, it “was”
four in the morning I wrote this piece; not
08:00:00 in UTC.

nobiot 
Sent from my iPhone
Details
Message ID
<CABzEscajn_s91uCLTdPpvKC3zf1PgOmJhT5HNM0zxKUh26XQaw@mail.gmail.com>
In-Reply-To
<0C399C47-969C-4B40-8B54-1A131C21072B@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
Strong +1 to local-time everywhere, exactly for the reasons nobiot outlines.

On Fri, Sep 22, 2023 at 8:44 PM Noboru <me@nobiot.com> wrote:
>
>
> > Perhaps we should default to UTC?
>
> Independent of this issue, personally I prefer
> the way it is now: local time everywhere. It sort
> of captures the moment of the time I
> experience—even if I was jet-lagged by flying
> from Paris to Tokyo, as an example, it “was”
> four in the morning I wrote this piece; not
> 08:00:00 in UTC.
>
> nobiot
> Sent from my iPhone



-- 
Cheers,
Vedang

https://vedang.me
@vedang on fosstodon.org
Details
Message ID
<87y1gvip8s.fsf@protesilaos.com>
In-Reply-To
<CABzEscajn_s91uCLTdPpvKC3zf1PgOmJhT5HNM0zxKUh26XQaw@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
> From: Vedang <ved.manerikar@gmail.com>
> Date: Sun, 24 Sep 2023 19:34:12 +0530
>
> Strong +1 to local-time everywhere, exactly for the reasons nobiot outlines.

This is my thinking as well and why this is the default right now.  But
maybe there is some good counter-point to consider.

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)