Is there any function in vb dot net to convert datetime to unix time stamp If I google I get only the vice versa but not vb.net to unix time stamp
Any help is appreciated
Is there any function in vb dot net to convert datetime to unix time stamp If I google I get only the vice versa but not vb.net to unix time stamp
Any help is appreciated
Not to plagiarize, but this looks like it will do the trick fairly easily, if you are talking about:
seconds since Jan 1, 1970 = unix time
Looking at http://www.codeproject.com/KB/cs/timestamp.aspx it shows unix->.net so you can go backwards most likely:
DateTime dt = "the date";
DateTime start= new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
TimeSpan ts = (dt - start);
ts.TotalSeconds //unix timestamp
or something similar will do it.
note, this has not been tested by me so it probably wont work :)