how to get accurate clock at lcd witouth RTC

i try use many codes to get clock time but it is usually not accurate, how to fix it problem

Replace the oscillator on your Arduino with a temperature compensated crystal oscillator (TCXO).

An RTC would probably be easier and cheaper though.

dannable:
Replace the oscillator on your Arduino with a temperature compensated crystal oscillator (TCXO).

An RTC would probably be easier and cheaper though.

thanks for reply
but rtc not available right now, i would like don this by suitable code

(deleted)

Husseinsalah:
thanks for reply
but rtc not available right now, i would like don this by suitable code

As has been mentioned, you cannot do this by code alone.

The Arduino running code, has no way of knowing how accurate its oscillator is or is not, it has no external referance.

If you could do it with code alone, there would be no need for RTCs.

Husseinsalah:
i try use many codes to get clock time but it is usually not accurate, how to fix it problem

Have you tried the millis() function, might be helpful!!

GautamD:
Have you tried the millis() function, might be helpful!!

Please read reply #3.

Use a GPS.
Or ethernet and NTP.