[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sString = Date(hBlah) returns 11pm


On Sat, 13 Apr 2024 at 11:47, Bruce Steers <bsteers4@xxxxxxxxx> wrote:

>
>
> On Sat, 13 Apr 2024 at 07:04, Gianluigi <gradobag@xxxxxxxxxxx> wrote:
>
>> Il 13/04/24 03:13, Jussi Lahtinen ha scritto:
>> >     If you know the format of the date sString gets and it doesn't
>> >     change (ie you're not changing locales) then you can also do:
>> >
>> >     sString = Replace(str(Date(Now)),"  00:00:00","")
>> >
>> >     After that: Print sString
>> >
>> >     will only print the date.
>> >
>> >
>> > This does not work if the application is running on a laptop and you
>> > travel or you simply live in a country that uses daylight "saving" time.
>> > IE, no need to change locales to mess it up.
>> >
>> > Jussi
>>
>> This routine:
>>
>> Public Sub Main()
>>
>>    Print CStr(Date(Now)) '<--- no local
>>    Print Str(Date(Now))
>>    Print Date(Now)
>>    Print Format(Now, gb.MediumDate)
>>
>> End
>>
>> here outputs this result to console:
>>
>> 04/12/2024 22:00:00
>> 13/04/2024 00:00:00
>> 13/04/2024 00:00:00
>> 13/04/2024
>>
>> Regards
>> Gianluigi
>>
>
> What I find confusing is that a couple of weeks ago assigning it to a
> String did NOT print the time part.
>
> Now it does.
> I suddenly noticed the Scoreboards on my Blockski+ game were displaying
> incorrectly.  and they deffo did not when i wrote the code.
>
> I dunno what changed?
>


Hmm, i guess changing from GMT to BST changed.

So i'm assuming before when it worked it used to give null as the time and
not print it,
now we are in BST it gives 23:00:00 UTC so it prints it.

Is that right?

Respects
BruceS

References:
sString = Date(hBlah) returns 11pmBruce Steers <bsteers4@xxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmBruce Steers <bsteers4@xxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmDimitris Anogiatis <dosida@xxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmGianluigi <gradobag@xxxxxxxxxxx>
Re: sString = Date(hBlah) returns 11pmBruce Steers <bsteers4@xxxxxxxxx>