Jump to content

Arty Ziff

Members
  • Posts

    67
  • Joined

  • Last visited

About Arty Ziff

  • Birthday 11/09/1963

Profile Information

  • Gender
    Male
  • Location
    Washington State

Arty Ziff's Achievements

Member

Member (2/5)

0

Reputation

  1. I've been working a lot with time calculations, and have a few that require sunrise / sunset. All of the online sources such as the Navy Observatory and just Googling consistently produce the same numbers. However, using the PHP sunrise sunset functions, I can never reproduce what I'm seeing from other sources. One of the variables is the Zenith. 90 is often used as a "ball-park", but usually it's more accurate around 90.833. In any case, even adjusting the Zenith, I'm unable to get anything closer than a few minutes to online sources consistently. My neck of the woods is Seattle / Tacoma, specifically the Lakewood area around McChord Air Force Base. Here's a sample of the code from a class I wrote to test the PHP function... public function sunrise() { $sunriseL = date_sunrise(time(),SUNFUNCS_RET_STRING,47.2529,-122.4443,90.833,-($z_offset)); $sunrise[0] = $sunriseL; $sunrise_array = explode(":",$sunriseL); $sunriseZ_hr = $sunrise_array[0] + $z_offset; // Add Z offset to local time... if ($sunriseZ_hr >= 24) { $sunriseZ_hr = $sunriseZ_hr - 24; } if (strlen($sunriseZ_hr) == 1) {$sunriseZ_hr = str_pad($sunriseZ_hr,2,"0",STR_PAD_LEFT); } $sunrise[1] = $sunriseZ_hr . ":" . $sunrise_array[1]; return $sunrise; // Return local and Z in an array... } Any ideas why PHP sunrise / sunset don't reproduce what other sources say? In the end, the sunrise / sunset algorithm is available and not all that complex, I can write my own function and get better accuracy. But that really astonishes me that the PHP functions are inconsistent with *everyone* else.
  2. Simple question: A row of data, one column of which is a large block of text. To store the text in the DB directly, or associate the row with a file that contains the text
  3. Each record has a fairly large block of text. Should I store the text block as a file and not in the DB?
×
×
  • Create New...

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.