Hi,
(Total VB newbie, plan to stay that way :-)
I would like to correct submitted time on a form-to-email web
application from Server Time to 'Customer Time' (i.e. subtract 3
hours). Is there a simple way to modify the VB function call:
FormatDateTime(Now, 0)
For example is Now actually a value, e.g. in seconds where I could do:
FormatDateTime(Now - 60 * 60 * 3, 0)
I bet that would be too easy...
Colin
Stoil Marinov - 29 Sep 2004 16:35 GMT
> Hi,
> (Total VB newbie, plan to stay that way :-)
[quoted text clipped - 4 lines]
> For example is Now actually a value, e.g. in seconds where I could do:
> FormatDateTime(Now - 60 * 60 * 3, 0)
Try this:
FormatDateTime(Now - 60 * 60 * 3 / 86400, 0)
Where 86400 is the number of seconds in a day (24 h).
Regards,
Stoil
> I bet that would be too easy...
> Colin
Martin Trump - 29 Sep 2004 16:37 GMT
>FormatDateTime(Now, 0) For example is Now actually a value, e.g. in
>seconds where I could do:
>FormatDateTime(Now - 60 * 60 * 3, 0)
Almost, but Now is in days and fractions of a day.
?format$(now,"hh:nn:ss")
16:35:28
?format$(now-1/24,"hh:nn:ss")
15:36:02
HTH.

Signature
Martin Trump
Martin Trump - 29 Sep 2004 16:43 GMT
Whoops, engage brain before posting. An addendum to my last posting.
You'll need to check id you're going back through midnight (noon as well
if you're using 24 hour clock time.
Regards

Signature
Martin Trump
eschuylerTAKE@THISadelphiaOUT.net - 29 Sep 2004 21:01 GMT
I think it's better to use the DateAdd() function, like this:
FormatDateTime(DateAdd("h", -3, Now), 0)
Regards,
Eric
>Hi,
>(Total VB newbie, plan to stay that way :-)
[quoted text clipped - 6 lines]
>I bet that would be too easy...
>Colin
Colin McNaught - 30 Sep 2004 18:42 GMT
Cool,
Looks like a great solution, thanks.
Colin
> I think it's better to use the DateAdd() function, like this:
>
[quoted text clipped - 13 lines]
> >I bet that would be too easy...
> >Colin