mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 01:38:24 +00:00
33 lines
No EOL
678 B
C#
33 lines
No EOL
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);
|
|
}
|
|
}
|
|
}
|
|
} |