Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread DateToStr question
Sat, May 20 2017 7:24 AMPermanent Link

Big Al

This is probably me being dumb, but in the manual it states

X := DateToStr(Date); // X is '02/13/2012'



However as best as I can see this is returning  a string containing 9 characters
5/20/2017

I think EWB is using my Short Date format on my computer, but what's the best was to always get a consistent date string back?

In this case I would prefer the leading zero.
Sat, May 20 2017 7:27 AMPermanent Link

Big Al

Big Al wrote:

This is probably me being dumb, but in the manual it states

X := DateToStr(Date); // X is '02/13/2012'



However as best as I can see this is returning  a string containing 9 characters
5/20/2017

I think EWB is using my Short Date format on my computer, but what's the best was to always get a consistent date string back?

In this case I would prefer the leading zero.



I changed my local computer settings to mm/dd/yyyy but it didn't seem to help so maybe it's not a short date problem, but I still need to get it fixed.
Sat, May 20 2017 8:23 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

EWB has its own date and time format settings:

     FormatSettings.ShortDateFormat := 'dd/MM/yyyy';
     FormatSettings.ShortTimeFormat := 'HH:mm';

Chris Holland
[Team Elevate]

On 20/05/2017 12:27, Big Al wrote:
> Big Al wrote:
>
> This is probably me being dumb, but in the manual it states
>
> X := DateToStr(Date); // X is '02/13/2012'
>
>
>
> However as best as I can see this is returning  a string containing 9 characters
> 5/20/2017
>
> I think EWB is using my Short Date format on my computer, but what's the best was to always get a consistent date string back?
>
> In this case I would prefer the leading zero.
>
>
>
> I changed my local computer settings to mm/dd/yyyy but it didn't seem to help so maybe it's not a short date problem, but I still need to get it fixed.
>

--
Chris Holland
[Team Elevate]
Sat, May 20 2017 9:12 AMPermanent Link

Big Al

>Chris Holland wrote:

>EWB has its own date and time format settings:

>     FormatSettings.ShortDateFormat := 'dd/MM/yyyy';
>     FormatSettings.ShortTimeFormat := 'HH:mm';

>Chris Holland
>[Team Elevate]

Chris, I put this in my form and it appears to work, but I am now getting a persistent load error.
Maybe I am putting it in the wrong place? It's currently in my FormCreate procedure.
Sat, May 20 2017 9:33 AMPermanent Link

Big Al

Big Al wrote:

>Chris Holland wrote:

>EWB has its own date and time format settings:

>     FormatSettings.ShortDateFormat := 'dd/MM/yyyy';
>     FormatSettings.ShortTimeFormat := 'HH:mm';

>Chris Holland
>[Team Elevate]

If I use
FormatSettings.ShortDateFormat := 'MM/dd/yyyy';

it gives me the error, but if I use
FormatSettings.ShortDateFormat := 'M/d/yyyy';
it does not.

It sure looks like the format I'm using should work.
Sat, May 20 2017 9:36 AMPermanent Link

Big Al


>If I use
>FormatSettings.ShortDateFormat := 'MM/dd/yyyy';

it gives me the error,

If I use MM it fails but M works.

Is this a small bug?
I am using latest version of EWB.
Mon, May 22 2017 8:27 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< If I use MM it fails but M works. >>

The manual shows the valid values for the ShortDateFormat:

http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TFormatSettings&prop=ShortDateFormat

Tim Young
Elevate Software
www.elevatesoft.com
Mon, May 22 2017 8:28 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< However as best as I can see this is returning  a string containing 9 characters
5/20/2017 >>

I fixed the examples in the manual so that they indicate the correct value without the leading space.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Jul 7 2017 10:41 AMPermanent Link

Big Al

>>Tim Young [Elevate Software] wrote:


>><< If I use MM it fails but M works. >>

>>The manual shows the valid values for the ShortDateFormat:

>>http://www.elevatesoft.com/manual?action=viewprop&id=ewb2&comp=TFormatSettings&prop=ShortDateFormat

According to that link MM is valid for the month. It should return the month with leading 0 if the month is less than 10.

I am using:
FormatSettings.ShortDateFormat := 'MM/dd/yyyy';

When I run the app I get the persistent error. If I use just M then it works but without the leading zero. I want the leading zero so that's why I'm using MM.

I am using V2.06 B4. I believe I was getting the same results with V2.06 B1, but did not check it on any other versions.

Big Al
Fri, Jul 7 2017 10:48 AMPermanent Link

Big Al

Well now it's working, not sure but I don't think I actually changed anything.

Never mind no reason to look at this for now.

Thanks

Big Al
Image