DateTimeFormatInfo.DateSeparator

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
====================================================
 
Back
Top