Wednesday, March 7, 2012

date format

Hi.
I have a field that has a date format.It shows like mm.dd.yyyy.
I want the format like dd.mm.yyyy.
How can i correct this.
I couldn't see this format.
Is there a letter (like d, g, vs.) for this?
Thanks!

you should be able to simply specify a date format string such as

dd/mm/yyyy

I don't believe a single letter string format such as d or g will work, as these formats will be driven from your regional settings.

|||

Hi muhsin,

you can wrap it in a format string like this

long date format = format(Fields!TimeStart.Value, "D")

or other examples are

= format(Fields!TimeStart.Value, "dd MMM yy - hh:mm:ss tt")

= format(Fields!TimeStart.Value, "dd MMM yyyy")

Look in the help section in your report designer window, Standard Date Time Format Strings in the .Net Framework Developers Guide.

Cheers,

99

|||Thanks but it didn't work.For example I have a date field like 07.12.2006.(mm.dd.yyyy)
I want it to be like 12.07.2006.(dd.mm.yyyy)
But your code made it like 12.51.2006 and I didn't understand where 51 came from.
Anyway thank you again for your opinions.|||

NinetyNine wrote:

Hi muhsin,

you can wrap it in a format string like this

long date format = format(Fields!TimeStart.Value, "D")

or other examples are

= format(Fields!TimeStart.Value, "dd MMM yy - hh:mm:ss tt")

= format(Fields!TimeStart.Value, "dd MMM yyyy")

Look in the help section in your report designer window, Standard Date Time Format Strings in the .Net Framework Developers Guide.

Cheers,

99


Thanks.Your code helped me but not at all. I wrote uor last code containing dd MMM yyyy.
It caused the field show like 12 Jul 2006.Then I changed MMM to MM.
Then it showed like 12 07 2006 and this is what I have been looking for.Thanks for the reply.

No comments:

Post a Comment