Home > Mobile >  How to remove seconds from a date and time stored in a variable
How to remove seconds from a date and time stored in a variable

Time:03-08

I've got a date like this one in a variable and I want to remove the seconds and milliseconds from it.

26/08/2021 19:56:30.844

I know I can remove milliseconds using Split(Start_Time_Value, ".")(0) but not sure what I can do to also remove the seconds. Can somebody help? Thanks

CodePudding user response:

Just format the string after, like so

format(Split(Start_Time_Value, ".")(0) ,"dd/mm/yyyy hh:mm")

  •  Tags:  
  • vba
  • Related