Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-05

Date value "0"

34 messages · 15 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla
to Juha Manninen

Il 26/05/2015 13:30, Juha Manninen ha scritto:

Show quoted text 7 lines
Regarding issue http://bugs.freepascal.org/view.php?id=27735 Is there some convention how to show a date value "0"? By default it shows year 1899. The patch changed it to "?".

Delphi for value 0 shows 12/30/1899 12:00 am:
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/System_TDateTime.html

Changing the old Delphi compatible default may force a number of users to modify user manuals/user instructions, messages etc. Is it really a wise move?

Giuliano

Reply by email

Mark Morgan Lloyd
to Giuliano Colla: Il 26/05/2015 13:30, Juha Manninen ha scritto: Delphi for value 0 shows 12/30/1899 12:00…
Giuliano Colla wrote 10 lines
Il 26/05/2015 13:30, Juha Manninen ha scritto: > Regarding issue > http://bugs.freepascal.org/view.php?id=27735 > > Is there some convention how to show a date value "0"? > By default it shows year 1899. The patch changed it to "?". > > Delphi for value 0 shows 12/30/1899 12:00 am:

Which is an entirely valid date, so should be displayed as such; it could entirely plausibly be a default starting point for e.g. astronomical calculations.

If it were something like Anno Domini 0, which quite simply never existed, then it could be displayed as invalid.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Schnell
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 5 lines
If it were something like Anno Domini 0, which quite simply never existed, then it could be displayed as invalid.

It's funny, but AFAIK, you are right. By definition, before Year 1 there was Year -1 and not Year 0.

Why TDateTime seemingly uses +2 = 1-1-0000 as a reference is still another riddle.

-Michael

Reply by email

Juha Manninen
to Giuliano Colla: Il 26/05/2015 13:30, Juha Manninen ha scritto: Delphi for value 0 shows 12/30/1899 12:00…

Amazing! Nobody actually looked at the Mantis report nor the patch I referred to, but still answered the mail.
The question is about LastUsed date of a Lazarus package link, shown in one of the IDE's dialog windows.
Value "0" is wrong in this context because nobody created Lazarus packages nor links between them at year 1899.
I leave it as "?", I guess there is no convention for such situations.

... but people please pay a little more attention before answering ...

Juha

Reply by email

Sven Barth
to Michael Schnell: Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-) -Michael
"Michael Schnell" wrote 8 lines
On 05/26/2015 01:30 PM, Juha Manninen wrote: > > Is there some convention how to show a date value "0"? > By default it shows year 1899. The patch changed it to "?". > Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-)

Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 12:00 am". Now add two days and we are at "1/1/1900 12:00 am", so all is well...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150527/41788110/attachment.html>

Reply by email

Michael Van Canneyt
to Sven Barth
Sven Barth wrote 12 lines
Am 26.05.2015 15:28 schrieb "Michael Schnell" : > > On 05/26/2015 01:30 PM, Juha Manninen wrote: >> >> Is there some convention how to show a date value "0"? >> By default it shows year 1899. The patch changed it to "?". >> > > Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-) Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 12:00 am". Now add two days and we are at "1/1/1900 12:00 am", so all is well...

Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ? Should not that be 00:00 am ? (or is that the same ?)

Michael.

Reply by email

Sven Barth
to Michael Van Canneyt
"Michael Van Canneyt" wrote 17 lines
On Wed, 27 May 2015, Sven Barth wrote: > > Am 26.05.2015 15:28 schrieb "Michael Schnell" : > > > > On 05/26/2015 01:30 PM, Juha Manninen wrote: > >> > >> Is there some convention how to show a date value "0"? > >> By default it shows year 1899. The patch changed it to "?". > >> > > > > Both funny, as DateTimeToStr(2.0) is "1-1-00" ;-) > > Why should that be funny? TDateTime(0.0) is defined as "12/30/1899 12:00

am". Now add two days and we are at "1/1/1900 12:00 am", so all is well...

Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ? Should not that be 00:00 am ? (or is that the same ?)

Honestly I don't know, as I simply copy-pasted the value mentioned by Mark, since I'm on mobile and thus a bit lazy ;)

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150527/6218176f/attachment.html>

Reply by email

Gordon Cooper
to Mattias Gaertner

We were taught that 24.00 did not exist. Time went from 23.59 to 00.00. The same rule can be applied to 11.59 am & pm.

Gordon.

Mattias Gaertner wrote 16 lines
On Wed, 27 May 2015 09:19:42 +0200 (CEST) Michael Van Canneyt wrote: > [...] > Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ? > Should not that be 00:00 am ? (or is that the same ?) You are not alone with such questions: https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mark Morgan Lloyd
to Gordon Cooper: We were taught that 24.00 did not exist. Time went from 23.59 to 00.00. The same rule…
Gordon Cooper wrote
We were taught that 24.00 did not exist. Time went from 23.59 to 00.00. The same rule can be applied to 11.59 am & pm.

Except where there's a leap second.

The same rule can be applied to 11.59 am & pm.

No it can't. You have to be prepared to parse 12:00 a.m. by context but it's usually midnight.

This is a deeply messy area, not helped at all by the odd conventions adopted by some of the early RTC chips which still turn up in embedded equipment.

Show quoted text 29 lines
Gordon. On 27/05/15 19:57, Mattias Gaertner wrote: > On Wed, 27 May 2015 09:19:42 +0200 (CEST) > Michael Van Canneyt wrote: > >> [...] >> Does 12:00 am actually exist ? If so, what is that ? Midnight or >> midday ? >> Should not that be 00:00 am ? (or is that the same ?) > You are not alone with such questions: > https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight > > > Mattias > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Graeme Geldenhuys
to Michael Schnell: To me (being born 12/31) it's funny that that the base is not a 1/1, especially 1/1/0001.…
Michael Schnell wrote
To me (being born 12/31) it's funny that that the base is not a 1/1, especially 1/1/0001. But of course this is completely irrelevant.

TDateTime's value of 0 being 1899-12-30 is something Borland adopted from Microsoft to be compatible with Microsoft's Excel or Access. And in turn Microsoft Excel tried to be compatible with Lotus 1-2-3. Back in the 90's I searched the internet for the explanation, but can't remember the details any more.

A quick google search now revealed this page, though it doesn't go into much detail.

"It appears that the reason for Delphi starting at 30 Dec 1899 is to make it as compatible as possible with Excel while at the same time not adopting Excel's incorrectness about dates."
[http://www.delphibasics.co.uk/RTL.asp?Name=TDateTime]

Do an internet search for "Microsoft date starts at 1899-12-30" and you'll find a lot more information.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mark Morgan Lloyd
to Michael Schnell
Michael Schnell wrote 7 lines
On 05/27/2015 11:05 AM, Mark Morgan Lloyd wrote: > > > No it can't. You have to be prepared to parse 12:00 a.m. by context > but it's usually midnight. > Of which day the one that also has 0:pm or of the previous ?

Wp "12-hour clock" shows 11:59 p.m. followed by 12:00 a.m., but I'm not 100% confident in this and sometimes you just have to guess :-)

Of course there's the interesting case where there's a leap second as well, because anybody foolish enough to insist on the 12 hour clock would see something like 11:59:59 11:59:60 p.m. 12:00:00 a.m.

Anybody with the least bit of sense uses ISO-8601 and 24-hour clock, but it's still possible to get into deep water when one gets things like astronomical observations or timezone offsets. Unfortunately there's a lot of legacy data and embedded kit floating around where timestamps are reported as BCD plus flag bits, and in particular there's things like (derivatives of) the 146818 chip which are both buggy and flexible enough that a firmware writer can make every conceivable bad decision leaving a heck of a mess for the poor so-and-do who has to make sense of logged data remotely.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Juha Manninen: Amazing! Nobody actually looked at the Mantis report nor the patch I referred to, but…
Juha Manninen wrote 9 lines
Amazing! Nobody actually looked at the Mantis report nor the patch I referred to, but still answered the mail. The question is about LastUsed date of a Lazarus package link, shown in one of the IDE's dialog windows. Value "0" is wrong in this context because nobody created Lazarus packages nor links between them at year 1899. I leave it as "?", I guess there is no convention for such situations. .. but people please pay a little more attention before answering ...

Mea culpa. But this sort of thing bites me so often that it's something I'm touchy about.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

waldo kitty
to Michael Van Canneyt: Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ? Should not that…
Michael Van Canneyt wrote
Does 12:00 am actually exist ? If so, what is that ? Midnight or midday ? Should not that be 00:00 am ? (or is that the same ?)

yes... 12:00am is midnight... 00:00am is the same... so also is 00:00 or 24:00 in 24hour time...

NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Michael Schnell
to waldo kitty
waldo kitty wrote
yes... 12:00am is midnight... 00:00am is the same... so also is 00:00 or 24:00 in 24hour time...

AFAIK it's rather set that 24:00 is 00:00 the next day, but 12:00 am is "not 100% confident" as Mark says.

-Michael

Reply by email

Giuliano Colla
to Michael Schnell

Il 28/05/2015 11:18, Michael Schnell ha scritto:

Show quoted text 8 lines
On 05/27/2015 08:48 PM, waldo kitty wrote: > > yes... 12:00am is midnight... 00:00am is the same... so also is 00:00 > or 24:00 in 24hour time... > AFAIK it's rather set that 24:00 is 00:00 the next day, but 12:00 am is "not 100% confident" as Mark says.

I don't believe this discussion will lead anywhere. The am/pm notation was intended only for humans living outside the polar circles, which just looking out of the window, can easily tell apart midnight from noon. And if they must set the hour for a meeting they don't say "at 12 pm" or "at 0 pm" or whatever, but just "at noon".
Even the (underdeveloped) countries which still stick to am/pm notation, when must give the train timetable or the airplane schedules, use the 24h notation.

Just my 2c

Giuliano

Reply by email

waldo kitty
to Michael Schnell: AFAIK it's rather set that 24:00 is 00:00 the next day, but 12:00 am is "not 100%…
Michael Schnell wrote 7 lines
On 05/27/2015 08:48 PM, waldo kitty wrote: > > yes... 12:00am is midnight... 00:00am is the same... so also is 00:00 or 24:00 > in 24hour time... > AFAIK it's rather set that 24:00 is 00:00 the next day, but 12:00 am is "not 100% confident" as Mark says.

i don't know why it isn't confident... am is morning so 12am is the very first entry into morning as 12pm is the very first entry into afternoon...

i don't understand the confusion or the problem...

NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Lukasz Sokol
to waldo kitty
waldo kitty wrote 5 lines
On 05/28/2015 05:18 AM, Michael Schnell wrote: > On 05/27/2015 08:48 PM, waldo kitty wrote: >> >> yes... 12:00am is midnight... 00:00am is the same... so also is >> 00:00 or 24:00 in 24hour time...

Day runs from 00:00:00 to 23:59:59 (or ::60) in 24h format ;) There is no 24:00:00 :) and must not be :)

Show quoted text 7 lines
>> > AFAIK it's rather set that 24:00 is 00:00 the next day, but 12:00 > am is "not 100% confident" as Mark says. i don't know why it isn't confident... am is morning so 12am is the very first entry into morning as 12pm is the very first entry into afternoon...

What of 00:00 AM then ? Same as 12:00 AM ?
S'pose it depends on who uses it ;)

i don't understand the confusion or the problem...

The confusion was what to convert Val(TdateTime) == 0 to ...in package view :)

el es

Reply by email

waldo kitty
to Jürgen Hestermann
J?rgen Hestermann wrote 8 lines
Am 2015-05-28 um 17:14 schrieb waldo kitty: > i don't know why it isn't confident... am is morning so 12am is the very first > entry into morning as 12pm is the very first entry into afternoon... > i don't understand the confusion or the problem... > So the day starts with 12 at midnight and then switches to 1 an hour later?

yes... 12am and 00:00am and 00:00 (24 hour mode) are all the same...

If that isn't confusing...

it isn't... it never has been, really... i've been using that form for over 50 years with no problems... granted, it doesn't work well with mod12 too well but then noon would be 00:00pm so there has to be some adjustment in code for the human aspect of rendering... it isn't that complicated... i was telling the time correctly by the time i was 3 or 4 and i know that my oldest granddaughter was doing so by 3 because i had a hand in her early education... it wasn't until i was older that i learned military 24 hour nomenclature... then later after that was the 100 minute hour they also use(d?)...

NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

patspiper
to Jürgen Hestermann: So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't…
J?rgen Hestermann wrote 11 lines
Am 2015-05-28 um 17:14 schrieb waldo kitty: > i don't know why it isn't confident... am is morning so 12am is the > very first entry into morning as 12pm is the very first entry into > afternoon... > i don't understand the confusion or the problem... > So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't confusing...

In am/pm mode, this is how it goes indeed. When it is 30 minutes past midnight, you say it is 12:30 (implicit am). An hour later, it becomes 1:30. In military time (24 hrs), then they become 00:30 and 1:30.

Stephano

Reply by email

Mark Morgan Lloyd
to Jürgen Hestermann: So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't…
J?rgen Hestermann wrote 9 lines
Am 2015-05-28 um 17:14 schrieb waldo kitty: > i don't know why it isn't confident... am is morning so 12am is the > very first entry into morning as 12pm is the very first entry into > afternoon... > i don't understand the confusion or the problem... > So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't confusing...

In fairness "12 Noon" is a common English idiom while "zero midnight" isn't. If using the 12-hour clock it's common to say "five to twelve" shortly before either midday or midnight and "five past twelve" afterwards... I've never heard anybody say "five past zero".

So I'd expect "12 Midnight" to not give anybody major problems.

But I still avoid setting equipment which reports time using a.m./p.m. around midnight or midday- who knows what ghouls lurk in the firmware.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marc Santhoff
to Jürgen Hestermann: So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't…
J?rgen Hestermann wrote 7 lines
Am 2015-05-28 um 17:14 schrieb waldo kitty: > i don't know why it isn't confident... am is morning so 12am is the very first entry into morning as 12pm is the very first entry into afternoon... > i don't understand the confusion or the problem... > So the day starts with 12 at midnight and then switches to 1 an hour later? If that isn't confusing...

Wikipedia tries to de-confuse a bit:

https://en.wikipedia.org/wiki/12-hour_clock
https://en.wikipedia.org/wiki/12-hour_clock#Confusion_at_noon_and_midnight

Other countries may have other conventions ...

For the germans:
https://de.wikipedia.org/wiki/2-mal-12-Stunden-Z%C3%A4hlung

HTH,
Marc

Marc Santhoff

Reply by email

Gordon Cooper
to Marc Santhoff

I once worked in the international section of the New Zealand Meteorological Servce, which used Greenwich Time (UTC). So, each day started at noon, 12 hours behind local time. Plenty of scope for confusion there.

Fortunately this was several decades before computers appeared.

Gordon.

Marc Santhoff wrote
> So the day starts with 12 at midnight and then switches to 1 an hour later? > >If that isn't confusing...

Reply by email

waldo kitty
to Mark Morgan Lloyd: Except where there's a leap second. No it can't. You have to be prepared to parse 12:00…
Mark Morgan Lloyd wrote 5 lines
Gordon Cooper wrote: > We were taught that 24.00 did not exist. Time went from 23.59 > to 00.00. The same rule can be applied to 11.59 am & pm. Except where there's a leap second.

speaking of which, guess what is coming up...

[quote]
Date: Mon, 05 Jan 2015 14:25:49 +0100
From: IERS EOP Product Center
Reply-To: IERS EOP Product Center
To:

INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)

SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE

SERVICE DE LA ROTATION TERRESTRE DE L'IERS
OBSERVATOIRE DE PARIS
61, Av. de l'Observatoire 75014 PARIS (France)
Tel. : 33 (0) 1 40 51 22 26
FAX : 33 (0) 1 40 51 22 91
e-mail :
http://hpiers.obspm.fr/eop-pc

Paris, 5 January 2015

Bulletin C 49

To authorities responsible for the measurement and distribution of time

UTC TIME STEP
on the 1st of July 2015

A positive leap second will be introduced at the end of June 2015. The sequence of dates of the UTC second markers will be:

2015 June 30, 23h 59m 59s
2015 June 30, 23h 59m 60s
2015 July 1, 0h 0m 0s

The difference between UTC and the International Atomic Time TAI is:

from 2012 July 1, 0h UTC, to 2015 July 1 0h UTC : UTC-TAI = - 35s from 2015 July 1, 0h UTC, until further notice : UTC-TAI = - 36s

Leap seconds can be introduced in UTC at the end of the months of December
or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
six months, either to announce a time step in UTC or to confirm that there
will be no time step at the next possible date.

Daniel Gambis
Head
Earth Orientation Center
of IERS
Observatoire de Paris, France
[/quote]

;) O:)

NOTE: No off-list assistance is given without prior approval. Please *keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Mark Morgan Lloyd
to Gordon Cooper: I once worked in the international section of the New Zealand Meteorological Servce,…
Gordon Cooper wrote
I once worked in the international section of the New Zealand Meteorological Servce, which used Greenwich Time (UTC). So, each day started at noon, 12 hours behind local time. Plenty of scope for confusion there.

But was conveniently in line with the astronomical convention of the day

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Tony Whyman
to patspiper: In am/pm mode, this is how it goes indeed. When it is 30 minutes past midnight, you say…

I must say that I'm amazed at how long this thread is - but then I shouldn't be.

Many moons ago, I used to work at the long gone British Mainframe Computer company ICL. Here, there was a well used term "a bicycle sheds argument". This supposedly came from the sales force retelling how the board of a large company had once taken two minutes to approve the purchase of a multi-million pound mainframe and then spent the next two hours discussing a small bill for the repair of the office bicycle shed. This was allegedly because they all understood bicycle sheds, but none of them had a clue how a computer worked.

This thread could well be an example of such an argument.

Perhaps we should leave it as:

The 24 hour clock is a modulo 24 numbering system, 12 hour clock is a modulo 12 numbering system starting at midnight and noon, where zero is conventionally written as "12", with conventions distinguishing the periods between noon and midnight and midnight and noon.

As to why this is so, I would quote the late great Douglas Adams "because the stupid monkey didn't know any better".

Tony

patspiper wrote 24 lines
On 28/05/15 18:57, J?rgen Hestermann wrote: > > Am 2015-05-28 um 17:14 schrieb waldo kitty: >> i don't know why it isn't confident... am is morning so 12am is the >> very first entry into morning as 12pm is the very first entry into >> afternoon... >> i don't understand the confusion or the problem... >> > > So the day starts with 12 at midnight and then switches to 1 an hour > later? > If that isn't confusing... In am/pm mode, this is how it goes indeed. When it is 30 minutes past midnight, you say it is 12:30 (implicit am). An hour later, it becomes 1:30. In military time (24 hrs), then they become 00:30 and 1:30. Stephano -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mark Morgan Lloyd
to Tony Whyman
Tony Whyman wrote 11 lines
I must say that I'm amazed at how long this thread is - but then I shouldn't be. Many moons ago, I used to work at the long gone British Mainframe Computer company ICL. Here, there was a well used term "a bicycle sheds argument". This supposedly came from the sales force retelling how the board of a large company had once taken two minutes to approve the purchase of a multi-million pound mainframe and then spent the next two hours discussing a small bill for the repair of the office bicycle shed. This was allegedly because they all understood bicycle sheds, but none of them had a clue how a computer worked.

:-)

Show quoted text 9 lines
This thread could well be an example of such an argument. Perhaps we should leave it as: The 24 hour clock is a modulo 24 numbering system, starting at midnight. The 12 hour clock is a modulo 12 numbering system starting at midnight and noon, where zero is conventionally written as "12", with conventions distinguishing the periods between noon and midnight and midnight and noon.

Yes, I think that's a good informal description. Particularly in view of the fact that efforts were made to measure time in Europe before numeric zero was widely adopted.

Now please let's not get bogged down in "unequal hours".

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email