Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Request for FormatDateTime
Mon, Nov 7 2016 9:15 AMPermanent Link

Matthew Jones

I think it would be really nice to have a standalone FormatDateTime routine, with a format string that allows you to take any DateTime and format it as you wish. So I could have "YYYY MM:NN:SS" if that's what I wanted, without having to alter the general "end user" ShortTimeFormat or whatever.

--

Matthew Jones
Mon, Nov 7 2016 11:38 AMPermanent Link

Raul

Team Elevate Team Elevate

On 11/7/2016 9:15 AM, Matthew Jones wrote:
> I think it would be really nice to have a standalone FormatDateTime routine, with a format string that allows you to take any DateTime and format it as you wish. So I could have "YYYY MM:NN:SS" if that's what I wanted, without having to alter the general "end user" ShortTimeFormat or whatever.

The central format idea is so EWB is consistent across controls,
datasets etc so the core stuff needs to remain.

The DateTimeToStr uses DateToStr and TimeToStr so easiest might be to
just provide a version of these functions that takes a custom
TFormatSettings instead of using built-in.

it's easy to quickly copy of your own custom version but having this at
framework level would make life even easier.

Raul
Mon, Nov 7 2016 2:27 PMPermanent Link

Matthew Jones

Raul <raul@removethis.raul.ca> wrote:
> On 11/7/2016 9:15 AM, Matthew Jones wrote:
>> I think it would be really nice to have a standalone FormatDateTime
>> routine, with a format string that allows you to take any DateTime and
>> format it as you wish. So I could have "YYYY MM:NN:SS" if that's what I
>> wanted, without having to alter the general "end user" ShortTimeFormat or whatever.
>
> The central format idea is so EWB is consistent across controls,
> datasets etc so the core stuff needs to remain.
>
> The DateTimeToStr uses DateToStr and TimeToStr so easiest might be to
> just provide a version of these functions that takes a custom
> TFormatSettings instead of using built-in.
>
> it's easy to quickly copy of your own custom version but having this at
> framework level would make life even easier.
>
> Raul
>
>

Indeed. It is because I don't want to mess with the "global" setting for a
utility purpose that I suggest it. A TFormatSettings param (perhaps
optional so nil reads the global) would be okay but pure string even
better.

--
Matthew Jones
Thu, Nov 10 2016 2:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I think it would be really nice to have a standalone FormatDateTime routine, with a format string that allows you to take any DateTime and format it as you wish. So I could have "YYYY MM:NN:SS" if that's what I wanted, without having to alter the general "end user" ShortTimeFormat or whatever. >>

Noted.

Tim Young
Elevate Software
www.elevatesoft.com
Image