Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date / Time Issues

Status
Not open for further replies.

chuckh70

Programmer
Feb 4, 2004
71
US
The SQL Server DB I am going against holds Unix Time,
and I need to be able to search against this field to get all records for that day, weekly, monthly

this get's me the current date time, and shows the Unix value, but I strip the time off so I can just use the date to search by.

Code:
Dim dtUTC As DateTime = DateTime.UtcNow

Dim dtStart As New DateTime(1970, 1, 1)

Dim tsDifference As TimeSpan = dtUTC.Subtract(dtStart)



Dim dblUnixStamp As Double = System.Math.Floor(tsDifference.TotalSeconds)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top