Dim strCurrentDate As String
Dim strDate As String, strTime As String
Dim strBackDate As String
Dim lnCurrentDate As Long
DateTime.DateFormat ="dd-MM-yyyy HH:mm:ss"
strCurrentDate = DateTime.Date(DateTime.Now)
Msgbox( strCurrentDate, "Right Now it is")
'DateTime.DateFormat ="mm/dd/yyyy HH:mm:ss"
strCurrentDate = DateTime.Date(DateTime.Now)
strDate = strCurrentDate.SubString2(0,strCurrentDate.IndexOf (" "))
strTime = strCurrentDate.SubString(strCurrentDate.IndexOf(" "))
lnCurrentDate =DateTime.TimeParse(strTime)
'lnCurrentDate= DateTime.DateParse(strDate)
'DateTime.DateFormat ="dd-MM-yyyy HH:mm:ss"
'strBackDate = DateTime.Date((lnCurrentDate/1000)-3600) 'Bad line
strBackDate = DateTime.Date(lnCurrentDate-3600*1000)
Msgbox( strBackDate, "One Hour before")