Let's take an example, salary RM1000
Start work 4 Oct , salary will be (1000/31) x 28 =903.23
So, for the first 3 days Oct? (1000/31) x 3 = 96.77
The total? 903.23 + 96.77 = 1000, no more and no less.
No matter which date and which month one starts work, the calculation will be correct. Of course you can use whatever method you want as long as you don't give less than what the employee deserves.