Thursday, 12 May 2016

Convert Date time to Unix timestamp

public static long ConvertToUnixTime(DateTime datetime)
    DateTime sTime = new DateTime(1970, 1, 1,0,0,0,DateTimeKind.Utc);
    return (long)(datetime - sTime).TotalSeconds;

1 comment:

  1. not a developer, I usually convert unix timestamp to human readable date using this free online tool:


Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...