I have small code to get the backdate but when I m running this program I get Parse Exception : Unparseable Date "06/02/2012"
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)
'lnCurrentDate = DateTime.DateParse(strCurrentDate)
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)
Msgbox( strBackDate, "One Hour before")
Thanks
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)
'lnCurrentDate = DateTime.DateParse(strCurrentDate)
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)
Msgbox( strBackDate, "One Hour before")
Thanks