Date Formatting

Stimulsoft Reports.NET discussion
Post Reply
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Date Formatting

Post by fkmfkm »

I tried to format the time to show AM/PM.....but not sucessful. Will custom formatting work ?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Date Formatting

Post by HighAley »

Hello.
fkmfkm wrote:I tried to format the time to show AM/PM.....but not sucessful. Will custom formatting work ?
Please, try to use this format mask

Code: Select all

hh:mm tt
If it is don't work then try to use this expression

Code: Select all

{YourDataSource.YourTextField.ToString("hh:mm:ss tt", CultureInfo.CreateSpecificCulture("en-US"))}
In order to make it work, please, add

Code: Select all

using System.Globalization;
in code tab.

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Date Formatting

Post by fkmfkm »

Aleksey wrote:Hello.
fkmfkm wrote:I tried to format the time to show AM/PM.....but not sucessful. Will custom formatting work ?
Please, try to use this format mask

Code: Select all

hh:mm tt
If it is don't work then try to use this expression

Code: Select all

{YourDataSource.YourTextField.ToString("hh:mm:ss tt", CultureInfo.CreateSpecificCulture("en-US"))}
In order to make it work, please, add

Code: Select all

using System.Globalization;
in code tab.

Thank you.
hh:mm tt works...

but how come the Time formattting does not work...It will cut down your support a lot if it works...
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Date Formatting

Post by HighAley »

Hello.
fkmfkm wrote:but how come the Time formattting does not work...It will cut down your support a lot if it works...
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
fkmfkm
Posts: 181
Joined: Thu Jul 05, 2007 11:26 pm
Location: Kuala Lumpur

Date Formatting

Post by fkmfkm »

Aleksey wrote:Hello.
fkmfkm wrote:but how come the Time formattting does not work...It will cut down your support a lot if it works...
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
I mean when i select Time format and Properties "*11:56 AM"; it does not show the AM/PM ...
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Date Formatting

Post by HighAley »

Hello.
fkmfkm wrote:I mean when i select Time format and Properties "*11:56 AM"; it does not show the AM/PM ...
It will appear if you choose right localization.
Please, use this code in your application.

Code: Select all

{YourDataSource.YourTextField.ToString("hh:mm:ss tt", CultureInfo.CreateSpecificCulture("en-US"))}
Please, see the attached report template.

Thank you.
Attachments
1290.Report.mrt
(17.82 KiB) Downloaded 300 times
Post Reply