on ‎2022 Dec 09 8:25 PM
I have a formula displayed in the top right corner of many reports called CurrentDateTimeString. The formula is ToText(CurrentDateTime). What I want to know is exactly what Windows OS regional settings are being used by Crystal to convert that DateTime to a string when no format is specified in the ToText function. Is this documented anywhere?
Request clarification before answering.
I believe it will use whatever the Windows Default format is for the computer where it's being run.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is definitely not what Crystal does. There is no "Windows Default format" for a combined Date and Time value. In C# there is a "standard format" called "G" which is not defined at the OS level. For C# that means "short date plus a space plus long time" but in our software prior to running a Crystal report using the .Net C# classes provided by Crystal if I change the current thread CultureInfo DateTimeFormatInfo object's ShortDatePattern and its LongTimePattern Crystal is ignoring those changes when it outputs a full DateTime value using ToText in a report but it is using the ShortDatePattern when it formats a Date field on the same report. The ToText(CurrentDateTime) field is set to "use default" formatting, i.e., not custom field formatting. The same is true for the Date fields. But nothing I have tried is able to convince Crystal to use the custom ShortDatePattern and LongTimePattern values that I have specified for the current thread when it outputs a DateTime value using the ToText function with no format specified.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.