1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 16:04:08 +01:00
Radarr/NzbDrone.Core/Datastore/Converters/UtcConverter.cs
2013-06-09 19:10:15 -07:00

33 lines
678 B
C#

using System;
using Marr.Data.Converters;
using Marr.Data.Mapping;
namespace NzbDrone.Core.Datastore.Converters
{
public class UtcConverter : IConverter
{
public object FromDB(ColumnMap map, object dbValue)
{
return dbValue;
}
public object ToDB(object clrValue)
{
if (clrValue == DBNull.Value)
{
return clrValue;
}
var dateTime = (DateTime)clrValue;
return dateTime.ToUniversalTime();
}
public Type DbType
{
get
{
return typeof(DateTime);
}
}
}
}