Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Unix time stamp
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; System.Threading.Thread.CurrentThread.CurrentCulture = customCulture; Console.WriteLine("Hello, world!"); double productExp = 24; DateTime expireDt = System.DateTime.UtcNow.AddHours(productExp); var expireTime = ConvertToUnixTimestamp(expireDt); Console.WriteLine(expireTime); } public static double ConvertToUnixTimestamp(DateTime gettime) { //create Timespan by subtracting the value provided from the Unix Epoch TimeSpan span = (gettime - new DateTime(1970, 1, 1, 0, 0, 0, 0).ToLocalTime()); Console.WriteLine(span); //return the total seconds (which is a UNIX timestamp) return (double)span.TotalSeconds; } } }
run
|
edit
|
history
|
help
0
Generics Operator test
remove special char
reverseandcheck
sfe
BC150401319
First Class
1
Root
math 5.74
Find Max Number Of Occurences in an int array