INNER CODE UNIT · C#
span
sdesalas/trifleJS · Extensions.cs:20
TimeSpan span = (date - new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime());
return (int)span.TotalSeconds;
}
return -1;
}
/// <summary>
/// Gets an entry in a dictionary by specifying its type
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="dictionary"></param>
/// <param name="key"></param>
/// <returns></returns>
public static T Get<T>(this Dictionary<string, object> dictionary, string key)
{
try
{
if (dictionary.ContainsKey(key)) {