Skip to content
Permalink
fe6569f37b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
19 lines (17 sloc) 598 Bytes
using System.Globalization;
namespace MauiWeatherForecast
{
public class LongToDateConverter : IValueConverter
{
DateTime _time = new DateTime(1970, 1, 1, 0, 0, 0, 0);
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
long dateTime = (long)value;
return $"{_time.AddSeconds(dateTime).ToString()} UTC";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}