Jump to content

Archived

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

ari_aaron

Compare date

Recommended Posts

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.

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

×

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.