|
-
Jul 28th, 2004, 12:50 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Convert.ToDateTime For Different Formats
Hi,
I'm currently working on project where the system is residing in LA, however I am testing it from my office in Rio.
What I want to do is collect a date from a form (as a string) and then save it in a variable as type DateTime.
(Please see code below).
Code:
public System.DateTime Birthday
{
get
{
System.DateTime dbBirthday = System.DateTime.MinValue;
try
{
dbBirthday = Convert.ToDateTime(this.txtbxBirthday.Text);
}
catch
{
dbBirthday = System.DateTime.MinValue;
}
return dbBirthday;
}
set
{
this.txtbxBirthday.Text = value.ToString("mm/dd/yyyy");
}
}
now this code works perfectly well when being called from a PC that is setup with the local settings of an Americn PC, but not with those settings from a Brazilian PC - ie dd/mm/yyyy instead of mm/dd/yyyy
as we want to make this available to all, i am trying to save the value using the System.Globalization.DateTimeFormatInfo.CurrentInfo object, but to no avail.
does aybody have any information on how to use these libraries?
thanks in advance,
Rodney
Last edited by stingrae; Jul 29th, 2004 at 04:01 PM.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|