Sensor with special date

Hello , I have made a sensor, but the problem, I can get the information, only 48h less or more, not fix… after the real time…so for exemple, now I have the information on the 02/05, what solution we have to enforce the time/date of the state, when we create this ?