[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sString = Date(hBlah) returns 11pm
[Thread Prev] | [Thread Next]
- Subject: Re: sString = Date(hBlah) returns 11pm
- From: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Sat, 13 Apr 2024 00:18:32 +0200
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Le 12/04/2024 à 22:52, Bruce Steers a écrit :
Not long ago using the following... Dim sString as String sString = Date(Now) Print sString Would print the date without the time
No. Date(Now) moves its date argument to midnight in the current local time.Affecting that date to a string variable converts it using CStr(), which will print the date in UTC time (and so with a time unless your local time is the UTC time).
It's `Print Date(Now)` or `sString = Str(Date(Now))` that will print a date at midnight (or without time).
Regards, -- Benoît Minisini.
Re: sString = Date(hBlah) returns 11pm | Bruce Steers <bsteers4@xxxxxxxxx> |
sString = Date(hBlah) returns 11pm | Bruce Steers <bsteers4@xxxxxxxxx> |