dt = ...some date and time variable or value ...
dayNumber = Month(dt) * 10000 + Day(dt) * 100 + (Year(dt) MOD 100)
timeNumber = Hour(dt) * 100 + Minute(dt)
But I would like to comment that your "dayNumber" is now a value that you can *NOT* compare!
That is, you can't do
If dayNumber1 > dayNumber2 Then
and have it do anything meaningful.
You'd be a lot better off using the format YYYYMMDD if you want to be able to compare the resultant numbers in any meaningful way.