Roger
asked on
How to change value of hours and seconds in the same date string?
I have a vba dateString variable in "longTime format" that is uncorrected for daylight saving,
I must adjust the hours value by -1, and then I need to adjust the seconds value by -1
Dim strDate As String
Dim dtDate As Date
The model of my string date:
strDate = Format(Time, "Log Time")n
I can change the hour parameter in that date
dtDate = DateAdd("h", -1, strDate)
or the second parameter
dtDate = DateAdd("s", -1, strDate)
But how do I change BOTH parameters in the same date?
("s", -1, strDate) and ("h", -1, strDate)
Thanks
Kelvin
I must adjust the hours value by -1, and then I need to adjust the seconds value by -1
Dim strDate As String
Dim dtDate As Date
The model of my string date:
strDate = Format(Time, "Log Time")n
I can change the hour parameter in that date
dtDate = DateAdd("h", -1, strDate)
or the second parameter
dtDate = DateAdd("s", -1, strDate)
But how do I change BOTH parameters in the same date?
("s", -1, strDate) and ("h", -1, strDate)
Thanks
Kelvin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kelvin