-
rest 2 hours to the system hour
I have got this code:
formatHour=FormatDateTime(Now,4)
hour=Mid(formatoHour,1,2) & Mid(formatoHour,4,1) & "0"
formatHour has got (for example) 10:15
then hour has got 1000
i want to rest 2 hours to the system hour, but i donot know.
I would want that formatHour have 8:15
Thankyou
Be careful with this:
If the system hour is 0:00 the desired hour should be: 22:00
-
-
the easiest way is to merely use dateadd thusly:
NewTime=dateadd("h",-2,formatHour)
NewTime will now contain the time in formathour minus two hours. It will work for any valid time of the day
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks