aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-03-27 19:51:29 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-03-27 19:51:29 +0300
commit953fc4deb9d94a63afe07d66ccf78ff42f54c3bb (patch)
tree9bc9eb73130a7f8bdc82f8f64b81476f78123d52 /Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs
parent69fb24f927bd0954a2765c71b09545df3fbba73c (diff)
downloadTango-953fc4deb9d94a63afe07d66ccf78ff42f54c3bb.tar.gz
Tango-953fc4deb9d94a63afe07d66ccf78ff42f54c3bb.zip
Working on logging module!
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs
new file mode 100644
index 000000000..0a9c47e48
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/DateTimeUTCToStringConverter.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ public class DateTimeUTCToStringConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ DateTime date = (DateTime)value;
+ return date.ToLocalTime().ToString(parameter.ToString());
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}