Skip to content

Instantly share code, notes, and snippets.

@DorukUlucay
Last active February 27, 2020 16:03
Show Gist options
  • Save DorukUlucay/c98a8f96971dbe7de1f2c16c8ce1916a to your computer and use it in GitHub Desktop.
Save DorukUlucay/c98a8f96971dbe7de1f2c16c8ce1916a to your computer and use it in GitHub Desktop.
from so
//https://stackoverflow.com/a/290265/1397858
private static readonly DateTime Jan1st1970 = new DateTime
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static long CurrentTimeMillis()
{
return (long) (DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
}
foreach (var line in File.ReadLines("test.txt"))
{
//do stuff here
}
//https://stackoverflow.com/a/16072742/1397858
byte[] bytes = Encoding.ASCII.GetBytes(someString);
string someString = Encoding.ASCII.GetString(bytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment