I'm creating a time conversion app using python. So what I want to implement in the project is that, when the user change the combobox, the value automatically change/converted depending on the units. For example, I have a base value of 1 second, if I select millisec, the value will be converted. If I select again a unit under combobox, the base number "1" will be converted instead of the value in millisec.
Is there a good logic about this? been trying things like when the user click the combobox, last value will be stored. But again, I want the base value to be converted.
I'm assuming the 'value' is inputted by some means such as an input box or etc. I am also assuming that you are trying to display the result in that same input box (or whatever component you are using).
If this is the case, you could hook onto when the value is changed and store the value it is changed to in some variable - your base value. When you programatically update the input box with the converted value, make sure the component is updated but the hooked function is not called. If this is not supported in whatever UI framework you are using, then you can make use of boolean flags:

Declare a flag which shall store whether or not the base value has been entered (initially false)
Declare a variable to store the base value
Hook onto when the component is changed.
When the component is changed, if the flag is false, store the value of the component in that base value variable you declared and set the flag to true. Otherwise, if the flag is true, don't do anything.
Do your calculations, etc and update the component programatically 
Once you have updated the component programatically, reset the flag to false.
Automatic Conversion Depending on Units in ComboBox