[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