Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old August 27th, 2004, 05:12 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

the way I told works for every regional settings.
do you have any problem somewhere?can you provide me with more info?
(regional settings is assigned to the control globally,although you can
change it everywhere you need locally).
HtH.

--------------------------------------------
Mehdi.:)
Reply With Quote
  #12 (permalink)  
Old August 28th, 2004, 03:57 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Hi Mehdi:
tnx for ur Mess & sorry for my delay! im pretty busy these days.

I knew {0:d}. but my date field came in string format like "830523" & I should mask it to 83/05/23.
thats why I asked here.
Tnx in advance.

& Dear Devon:
Regional Settings is a cliend side & its just a windows setting. it can NOT me my answer!

Always:),
Hovik Melkomian.
Reply With Quote
  #13 (permalink)  
Old August 28th, 2004, 06:23 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Hovik,
IMO if you work with DateTime it would be much better
Have a look at this ...
Code:
DateTime dt=new DateTime(1382,2,28);
CultureInfo MyCulture =  new CultureInfo("fa-IR");//persian culture
TextBox1.Text=dt.ToString("yyyy/MM/dd",MyCulture);
although this culture wasnt installed in .NET properly!!!(it acts like en-US)
but as you see I use yyyy/MM/dd for my pattern to simulate persian date
correcly...
for format string you can change your string variable like below
Code:
string m="13820228";
m=m.Insert(4,"/");
m=m.Insert(7,"/");
TextBox1.Text=m;
anyway as you see its better to use DateTime ...
(your date field in your datasource should be as a datetime type
instead nvarchar or ...)
HtH.

--------------------------------------------
Mehdi.:)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert British format date to American format? fyr PHP How-To 0 December 19th, 2007 03:17 PM
date format differs, need to force format somehow patricolsson HTML Code Clinic 2 January 12th, 2006 05:55 AM
Date/Time format & multiple selection with listbox frmsasp ASP.NET 1.0 and 1.1 Basics 0 October 13th, 2005 05:50 AM
* where date >= '"& dateVar &"' order by date wrofox Classic ASP Databases 5 February 24th, 2005 10:11 AM
bindings & images miguel.ossa C# 1 August 20th, 2004 01:02 AM



All times are GMT -4. The time now is 05:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.