Mam DateTime Converter do którego dopisałem polską formę daty tzn. 26 maja 2013 i chcę jeszcze żeby godzinę też pokazywało z naszej strefy a nie -2 godziny.
Próbowałem kilka rzeczy znalezionych w necie, np.: DateTime newDate = date.AddHours(2); ale mi to nie działa
Proszę o pomc.
namespace ............
{
public class RssDateTime : System.Windows.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
CultureInfo polish = new CultureInfo("pl-PL");
return ((DateTime)value).ToString("dd MMMM yyyy, H:mm", polish);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
DateTime dateTime;
if (DateTime.TryParse(value.ToString(), out dateTime))
{
return dateTime;
}
return value;
}
}
}