Home All Groups Group Topic Archive Search About

DateTimeFormatInfo.DateSeparator

Author
21 Apr 2006 8:08 AM
kh
hi. DateTimeFormatInfo.DateSeparator seems to supply the separator for the
short date pattern (for axample, "/" in en-GB) but the long date pattern is
"dd MMMM yyyy" which is obviously separated by spaces. is there a generic way
to determine the date separator for the current LongDatePattern?

thanks

kh

Author
21 Apr 2006 10:48 AM
Linda Liu [MSFT]
Hi ,
Thank you for posting.
There's no property in DateTimeFormatInfo supplied for the separator  of
the long date pattern. But you can set the LongDatePattern property of 
DateTimeFormatInfo to set the separator.
The following is a sample.

DateTimeFormatInfo myDTFI = new CultureInfo("en-GB", false).DateTimeFormat;
// here use "##" as the separator
myDTFI.LongDatePattern = "dd##MMMM##yyyy";

Hope this is helpful to you.
If you have any other concerns, or need anything else, please don't
hesitate to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================

AddThis Social Bookmark Button