General question about timestamps

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tores
Forum Contributor
Posts: 120
Joined: Fri Jun 18, 2004 3:04 am

General question about timestamps

Post by tores »

hi.

When I work with time I use timestamps, because their more convenient to work with than regular dates. So when I want to add e.g. three days to a date I just add 3 * 86400, which is three days in seconds. But I'm not sure if this is the correct way of doing it. Could such operations produce an erroneous result when dealing with things like daylight-saving time?

regards tores
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

daylight savings has nothing to do with the actual timestamp. Adding 3 * 86400 is perfectly fine, as time doesn't repeat itself (for us at least), even when talking about daylight savings.
Post Reply