juan_gandhi: (Default)
Juan-Carlos Gandhi ([personal profile] juan_gandhi) wrote in [site community profile] dw_dev2024-01-27 04:52 pm

date range

 I recently found I need to have dates in my posts before 01/01/1970. The reason being, I want to enter some diary records. I guess there may be other reasons for entering posts dated before 01/01/1970.

Had a discussion with support; they reasonably answered that 01/01/1970 00:00:00UTC is unix time zero.

The thing is, negative time does no harm; we can successfully go down to about Dec.13th, 1901 (as Wikipedia says). Maybe when we get closer to 2038, and 64-bit timestamps will make more urgent sense, we'll be able also to go down to ancient times, and record Roman or Egyptian history, but that's in the future.

I wonder how hard it would be to go ahead and widen the limits of timestamps. In my view, it must not be a big deal, right.

In our company, HealthExpense, now, unfortunately, nonexistent, we used this feature to mark patients dates of birth (since we had no patient born before December 1901). I think I even have some Scala classes for that, but have to ask whether they can be used. 

Anyway, dw is not written in Scala, but still, this can feature can be added as an experiment.

What do you think? 

(I've just joined this group, and this is my first post, so I might be missing something, please correct me in this case.)

madgastronomer: detail of Astral Personneby Remedios Varo (Default)

[personal profile] madgastronomer 2024-01-27 10:24 pm (UTC)(link)
Do not assume anything to do with timestamps "does no harm" or "must not be a big deal". Ever.
spiffikins: (Default)

[personal profile] spiffikins 2024-01-27 10:47 pm (UTC)(link)
THIS!
madgastronomer: detail of Astral Personneby Remedios Varo (Default)

[personal profile] madgastronomer 2024-01-28 12:20 am (UTC)(link)
In all seriousness, if you've dealt with timestamps, why are you assuming this isn't a big deal?
madgastronomer: detail of Astral Personneby Remedios Varo (Default)

[personal profile] madgastronomer 2024-01-28 01:02 am (UTC)(link)
You don't think the massive legacy codebase could possibly cause problems, huh? In Perl, so probably not using exclusively C data types. And then there's the database schema! I know I'm not as experienced as you in a general sense, but I also know these things have tripped up devs here before on things that "should have been easy".
vass: Small turtle with green leaf in its mouth (Default)

[personal profile] vass 2024-01-27 10:50 pm (UTC)(link)
As [personal profile] madgastronomer said, timestamps can be way trickier than you'd imagine. Brain-meltingly so.

That said, thanks for posting the feature request, I think it's a good suggestion to make even if implementing might not be straightforward at all. In addition to users wanting to import journal entries from before 1970, there are probably roleplayers who'd like to date their characters' entries in the past.

And as you say, 2038 is approaching, so something's going to have to change in the next (gulp) 14 years.
beldmit: (Программизм)

[personal profile] beldmit 2024-01-28 12:01 pm (UTC)(link)
I don't believe that it's easy. I have never looked at DW code so the rest is just my hypothesis.

First, I presume DW is written in Perl (as it inherits the original LJ code). Perl has a lot of modules for date/time manipulation, though all of them ave caveats and corner cases. It will require a lot of efforts to properly change the data processing.

Second, I presume the dates are stored in a regular database in a format native to this database. If it doesn't support negative date, it would be necessary to provide some workaround (also stored in the database, and so altering the structure - which is a pain for big enough data) and reimplement al the procedures currently fetching this data and processing it (see p.1).

I clearly understand your intentions but if I was a developer I would strongly dodge from implementing this :)