Date object - when is 12:00 AM?

A Date object stores the number of seconds since 12:00 AM on 1 Jan 1904. Hopefully this means since midnight on that day (i.e. 00:00) but I can’t be sure as officially, 12:00 AM is ambiguous (see the National Physical Laboratory website http://www.npl.co.uk/reference/faqs/is-midnight-12-am-or-12-pm-faq-time), where it states “There are no standards established for the meaning of 12 a.m. and 12 p.m.”

As the NPL says “… to avoid confusion it is always better to use the 24-hour clock, when … 24:00 Sunday or 00:00 Monday both mean 12 midnight Sunday/Monday”

Please remove this ambiguity.

thanks,
Richard

create a date object with a time of 12am and then change its minutes = minutes -1
and then see if the date object is now set to the day before.

Remember: AM/PM is not used everywhere in the world…

I think you are talking about:
https://documentation.xojo.com/index.php/Date

and you want it to change to:

@Paul Lefebvre can change that. Maybe even add something like:

Dim d as new date(1904, 1, 1, 0, 0, 0)  // Total Seconds equal 0

Note: to people don’t understanding the issue, in some countries that use AM/PM, AM could be used as 00:00 for that day (as the Date document use it), or 24:00 for that day (this way 0 Total Seconds will be 00:00 hrs, January 2, 1904).

I’m curious …
So how do other parts of the world differentiate between before “mid-day” and after? I assume they don’t use a 24 hour clock?

[quote=423340:@Alberto De Poo]I think you are talking about:
https://documentation.xojo.com/index.php/Date

and you want it to change to:

@Paul Lefebvre can change that. Maybe even add something like:

Dim d as new date(1904, 1, 1, 0, 0, 0)  // Total Seconds equal 0

Note: to people don’t understanding the issue, in some countries that use AM/PM, AM could be used as 00:00 for that day (as the Date document use it), or 24:00 for that day (this way 0 Total Seconds will be 00:00 hrs, January 2, 1904).[/quote]

note that even on a 24 hour clock 00:00:00 and 24:00:00 denote “midnight”

That said the base date is midnight, 00:00:00 January 1, 1904.

That’s the problem, “midnight”.
For me, midnight February 1, 2019 = Tonight = 00:00:00 February 2, 2019

If you decide to change the information, please just use: 00:00:00 January 1, 1904 (without midnight)

Look now.

Thank you Norman for taking the time to open a feature request feedback://showreport?report_id=54819

Thank you Paul for updating the docs.

Thank you Kem.

You’re welcome.

– Not Paul

:stuck_out_tongue:

Norm added some comments to the case - for clarification.

I am unable to add information to that case, but after 23:59:59 comes 00:00:00. 24:00:00 is not a real time.
https://stackoverflow.com/a/13060541/6047977

More info. can be found here:

https://en.wikipedia.org/wiki/ISO_8601#Times

Date will never return 24:00:00 as the time. I stand by what I said.

dim dt as new Date
dt.Month = 1
dt.Day = 31
dt.Second = 0
dt.Minute = 0
dt.Hour = 24

break

And being ex-military involved with multi-nation communication, I can also add weight to the fact that there is no such time in any global, official communication of 24:00:00. There is 23:59:59 and the next second is 00:00:00.

I have worked as a contractor for the Air Force for 15 years and never used 24:00:00 in communication, it is always 23:59:59 or 00:00:00, there is no 24:00:00

So, basically, the time is a zero-based variable where:

For theTime = 00:00:00 to (24:00:00 - 00:00:01) WasteTime() End For
:slight_smile:

[quote]Dave S: I’m curious …
So how do other parts of the world differentiate between before “mid-day” and after? I assume they don’t use a 24 hour clock?[/quote]
Actually they do. The 24 hour clock is used in everyday speech in a wide range of countries and languages.

As for the existence or otherwise of 24:00:00, please check the NPL web-page I quoted in the OP. According to them (and they are the people responsible for physical standards in the UK, and whom we can therefore assume to be authoritative), it does exist, and is the same instant as 00:00:00 the following day (and therefore completely redundant). The reason it is not used is because it’s redundant, not because it doesn’t exist.

Thanks Kem for the update to the documentation which removes the ambiguity.

cheers,
Richard

[quote=423341:@Dave S]I’m curious …
So how do other parts of the world differentiate between before “mid-day” and after? I assume they don’t use a 24 hour clock?[/quote]
If I am using a digital time (always the case on a computer) I always use a 24 hour clock, and never use am or pm. In everyday speech I might, and of course the wall (analogue) clock is a 12 hour clock.

So on my menubar it now says Sat 2 Feb 18:57:04.

[quote=423485:@Richard Francis]Actually they do. The 24 hour clock is used in everyday speech in a wide range of countries and languages.

As for the existence or otherwise of 24:00:00, please check the NPL web-page I quoted in the OP. According to them (and they are the people responsible for physical standards in the UK, and whom we can therefore assume to be authoritative), it does exist, and is the same instant as 00:00:00 the following day (and therefore completely redundant). The reason it is not used is because it’s redundant, not because it doesn’t exist.

Thanks Kem for the update to the documentation which removes the ambiguity.

cheers,
Richard[/quote]

Not only does it exist there is also the very real possibility of having a valid time that is 23:59:60 should a positive leap second need to be added. ISO 8601 and NPL both make note of this possibility. There is also the possibility that a negative leap second needs to be added which could result in the time going from 23:59:58 to 24:00:00. Such fun!