robert_gsfame Posted July 10, 2010 Share Posted July 10, 2010 let say i have date("Y-m-d, H:i") and assume it was $date=2010-09-03, 11:00 and i wish to find the difference between $date and today's date actually i know how to find it but it always depends on each user's computer date how can i get a fix result so that each user will have the same result even if they try to change their computer date thx Link to comment https://forums.phpfreaks.com/topic/207317-date-problem/ Share on other sites More sharing options...
JasonLewis Posted July 10, 2010 Share Posted July 10, 2010 PHP can't access the users computer date directly. You'll need input from the user. Get the users timezone, which is what they'll have to input. Then you can use gmdate and add or subtract the timezone offset for the users input. Some people won't select their timezone, that's their problem. There's nothing you can do about it. Link to comment https://forums.phpfreaks.com/topic/207317-date-problem/#findComment-1083916 Share on other sites More sharing options...
robert_gsfame Posted July 10, 2010 Author Share Posted July 10, 2010 okay, thx! Link to comment https://forums.phpfreaks.com/topic/207317-date-problem/#findComment-1083919 Share on other sites More sharing options...
robert_gsfame Posted July 10, 2010 Author Share Posted July 10, 2010 so if two users have set their own pc date differently then i they will have different time result? Link to comment https://forums.phpfreaks.com/topic/207317-date-problem/#findComment-1083920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.