Jump to content


Photo

Compare date


  • Please log in to reply
2 replies to this topic

#1 ari_aaron

ari_aaron
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts
  • LocationToronto, Canada

Posted 09 April 2006 - 03:28 PM

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.

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 09 April 2006 - 05:42 PM

[!--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) View Post[/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?
$today = date("Ymd"); // yyyymmdd on your server

Legend has it that reading the manual never killed anyone.
My site

#3 ari_aaron

ari_aaron
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts
  • LocationToronto, Canada

Posted 09 April 2006 - 06:53 PM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users