Now() function with time trim

前端 未结 6 1039
忘了有多久
忘了有多久 2020-12-16 10:23

So the function =Now()....is there a way I can use this and only get the date, not the time?

or is there just a function for this idea?

6条回答
  •  清歌不尽
    2020-12-16 11:01

    Dates in VBA are just floating point numbers, where the integer part represents the date and the fraction part represents the time. So in addition to using the Date function as tlayton says (to get the current date) you can also cast a date value to a integer to get the date-part from an arbitrary date: Int(myDateValue).

提交回复
热议问题