Tobi,
Thanks for the pointer to that thread. I had tried searching the message
archives, but I probably didn't find it since I was looking for bugs
related to the Format function.
I did try changing CDate(...) to Date(...), but it didn't change my
results. I had also tried an implicit
On Sat, 19 May 2018, George wrote:
> > CDate uses UTC and, without the time information in the string, it would
> store midnight. Format uses local time.
>
> That is definitely part of the issue. My local time is GMT-04, and here's
> what I get when specifying the time in my test:
>
> Test
I noticed a post from BenoƮt in another thread that this mailing list has
been deprecated, so I'm going to repost this in u...@lists.gambas-basic.org
On Sat, May 19, 2018 at 1:20 PM, George wrote:
> > CDate uses UTC and, without the time information in the string, it
> CDate uses UTC and, without the time information in the string, it would
store midnight. Format uses local time.
That is definitely part of the issue. My local time is GMT-04, and here's
what I get when specifying the time in my test:
Test date: 5/4/2018 03:59:00 Formatted: 05/03/18 Thu
Test
But Debug (Print) localizes!
However, with the dates I always get lost :-(
Regards
Gianluigi
2018-05-19 16:00 GMT+02:00 T Lee Davidson :
> CDate uses UTC and, without the time information in the string, it would
> store midnight. Format uses local time.
>
> So,
CDate uses UTC and, without the time information in the string, it would store
midnight. Format uses local time.
So, anyone in a time zone behind UTC will get the previous day printed. Try
this format string:
zTestResult = Format(CDate(zTestDate), "mm/dd/yy hh:nn ddd")
Does the difference in
It also works with Gambas 3.11.2
'' Main.Main.9: Test date: 5/4/2018 00:00:00 Formatted: 05/04/18 ven
Regards
Gianluigi
2018-05-19 15:36 GMT+02:00 George :
> Sorry, I should have added that I'm on version 3.11.2
>
> On Sat, May 19, 2018 at 9:27 AM, George
I'm using the repository '
http://ppa.launchpad.net/gambas-team/gambas3/ubuntu'
Is there something that's more up-to-date?
On Sat, May 19, 2018 at 9:08 AM, Gianluigi wrote:
> I think it depends on your version of Gambas, I get the correct result with
> the master:
>
>
I think it depends on your version of Gambas, I get the correct result with
the master:
Dim zTestDate As String
Dim zTestResult As String
zTestDate = "5/4/2018"
zTestResult = Format(CDate(zTestDate), "mm/dd/yy ddd")
Debug "Test date: " & zTestDate & " Formatted: " & zTestResult
''
When using the Format function to format a date, the date gets offset by 1
day. Here's an example:
Dim zTestDate As String
Dim zTestResult As String
zTestDate = "5/4/2018"
zTestResult = Format(CDate(zTestDate), "mm/dd/yy ddd")
Debug "Test date: " & zTestDate & " Formatted: " &
10 matches
Mail list logo