mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-30 05:09:37 +00:00
Basic re-auth framework in place
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace PodNoms.Api.Utils
|
||||
{
|
||||
|
||||
public class DateUtils
|
||||
{
|
||||
public static DateTime ConvertFromUnixTimestamp(double timestamp)
|
||||
{
|
||||
namespace PodNoms.Api.Utils {
|
||||
public class DateUtils {
|
||||
public static DateTime ConvertFromUnixTimestamp(double timestamp) {
|
||||
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
||||
return origin.AddSeconds(timestamp);
|
||||
}
|
||||
|
||||
public static double ConvertToUnixTimestamp(DateTime date)
|
||||
{
|
||||
public static double ConvertToUnixTimestamp(DateTime date) {
|
||||
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
|
||||
TimeSpan diff = date.ToUniversalTime() - origin;
|
||||
return Math.Floor(diff.TotalSeconds);
|
||||
|
||||
Reference in New Issue
Block a user