![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 4 of 4 total |
![]() |
Mon, Jun 15 2015 11:12 AM | Permanent Link |
Doc | function PresentTime: String;
var T: String; begin FormatSettings.TimeSeparator:=':'; FormatSettings.ShortTimeFormat := 'HH:mm'; T := TimetoStr (Now); //if Length (T) > 5 then T := Copy (T,1,5); Result := '*' + T + '*'; end; I would like to have the time String in 24h format, e.g. 16:40. The function above leads to a result with a trailing space character (*16:40 *), so I have to insert an additional line for cutting this character from the end (commented out above). Is this a sort of bug? In the 12h format there is a space character before the AM or PM. |
Mon, Jun 15 2015 12:21 PM | Permanent Link |
Raul ![]() | On 6/15/2015 11:12 AM, Doc wrote:
> T := TimetoStr (Now); > //if Length (T) > 5 then T := Copy (T,1,5); or just T := '*' + trim(T) + '*'; > The function above leads to a result with a trailing space character (*16:40 *), so I have to insert an additional line for cutting this character from the end (commented out above). > Is this a sort of bug? In the 12h format there is a space character before the AM or PM. Yes it's a bug - it's caused by the "if (I < 2) then" section after the "case" section - it inserts a space if there is no seconds specifier in the shorttimeformat. if you used a format with seconds (HH:mm:ss) it would be OK. Meanwhile just doing a trim should work around the issue Raul |
Mon, Jun 15 2015 4:08 PM | Permanent Link |
Doc | Raul wrote:
or just T := '*' + trim(T) + '*'; Meanwhile just doing a trim should work around the issue _____________________________________________ Thank you very much ! I wasn't aware of a trim function yet, very helpful ! (The * were just to visualize the space charactes) |
Tue, Jun 16 2015 7:50 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Doc,
<< The function above leads to a result with a trailing space character (*16:40 *), so I have to insert an additional line for cutting this character from the end (commented out above). Is this a sort of bug? In the 12h format there is a space character before the AM or PM. >> This is now fixed in both 1.x and the 2 preview. The fix for 2 will be in the final release. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, November 29, 2023 at 09:43 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |