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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Wrong Regional Setting 1
DateTIme help 2
One more regular expression 4
regex syntax 12
Windows 7 and DateTimePicker control? 0
Giveaway The Division FREE 2
Split a date 2
Date (multiple) format in textbox 1

Back
Top