Thursday, 12 May 2016

convert a Unix time value to a DateTime

public static DateTime UnixTimeToDateTime(long unixtime)
{
    DateTime sTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
    return sTime.AddSeconds(unixtime);
}

No comments:

Post a Comment

Featured post

Getting Started With SOLR

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