Jump to content

Timestamp use


simpli

Recommended Posts

Hi, I have been trying to get the difference in days (or week/month/year) between two dates but I haven't been able to make it work so I'm considering doing it with timestamps. This brings a question to me. If I use a timestamp, am I still going to have to worry about DST (daylight saving times)  and leap years? If so anyone can tell me how I should deal with them.

Any help is wanted I am really stuck and dont know what to do / where to turn to get a coherent way to calculate those differences.

Thanks in advance,

JR

Link to comment
https://forums.phpfreaks.com/topic/198918-timestamp-use/
Share on other sites

I assume php knows about that already. Why, have you seen a problem related to leapyears? The code I given converts to timestamp. Timestamp is the number of seconds since 1/1/1970. As its the number of seconds (and infact correct) it should know if it was a leap year or not and add/deduct a day?

Link to comment
https://forums.phpfreaks.com/topic/198918-timestamp-use/#findComment-1044128
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.