ari_aaron Posted April 9, 2006 Share Posted April 9, 2006 How can I make a script that selects a row in an SQL table where a date(stored in date(yyyymmdd)) is today.Or, even better, check if now is after sunset of the previous day, and before sunset of that day. Link to comment https://forums.phpfreaks.com/topic/6949-compare-date/ Share on other sites More sharing options...
AndyB Posted April 9, 2006 Share Posted April 9, 2006 [!--quoteo(post=363012:date=Apr 9 2006, 11:28 AM:name=ari_aaron)--][div class=\'quotetop\']QUOTE(ari_aaron @ Apr 9 2006, 11:28 AM) [snapback]363012[/snapback][/div][div class=\'quotemain\'][!--quotec--]How can I make a script that selects a row in an SQL table where a date(stored in date(yyyymmdd)) is today.Or, even better, check if now is after sunset of the previous day, and before sunset of that day.[/quote]Now is always after sunset yesterday, because now is today.Would you care to be more specific as to what you want. As to when 'sunset' occurs, php is a scripting language, not 'magic'. I suspect you'll have to arbitrarily assign a value of 'sunset' (possible depending on today's month).Are these dates as determined by your server, determined by your user's local time/date, GMT dates, etc?[code]$today = date("Ymd"); // yyyymmdd on your server[/code] Link to comment https://forums.phpfreaks.com/topic/6949-compare-date/#findComment-25271 Share on other sites More sharing options...
ari_aaron Posted April 9, 2006 Author Share Posted April 9, 2006 I'm sorry, but in the php manuel ([a href=\"http://ca3.php.net/manual/en/function.date-sunset.php\" target=\"_blank\"]http://ca3.php.net/manual/en/function.date-sunset.php[/a]) it gives a function date_sunset(). I wanted to know how else you could get the longituse/latitude locations.Can you help with the first question? Link to comment https://forums.phpfreaks.com/topic/6949-compare-date/#findComment-25296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.