Jump to content

jim2281950

New Members
  • Posts

    5
  • Joined

  • Last visited

jim2281950's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I wondered why the 'i' was used. Thought that was an option and 'm' was interpreted by context. Changing to 'i' solved the problem. Thanks requinix.
  2. 'Y-m-d' - months and 'H:m:s' - minutes. I added '0 minutes 0 seconds' to the format string with no change in the result. I tried 'print' in addition to 'echo', with no change in the result.
  3. Correction: The problem code: $date4=date_create(date("y-m-d")); date_add($date4,date_interval_create_from_date_string("06 Hours")); echo date_format($date4,"Y-m-d, H:m:s")." date4\n";
  4. Yes. I ran : echo(date('d-m-y h:i:s'))." = current date"; The correct result: 04-06-21 10:39:58 current date I think the problem originates in the following command: $start = date_add(date_create(),date_interval_create_from_date_string("6 hours"));
  5. My script reports the time with a six minute error added to the current time. I can't figure out why. I wrote a different script for solar calculation and get a 7 minute error subtracted. I'm hoping a response to this post will help me solve both problems. I abbreviated the six minute error script to simplify the problem. ===================================================== date_default_timezone_set("America/New_York"); $date = new DateTime(); $date4 = new DateTime(); echo(date("Y-m-d H:i:s"))." date\n"; $now = new DateTime(); $timestring = $now->format('Y-m-d H:i:s'); echo($timestring)." timestring\n"; $date2=date_create(date("y-m-d")); $date4=date_create(date("y-m-d")); date_add($date,date_interval_create_from_date_string("0 Hours")); date_add($date4,date_interval_create_from_date_string("06 Hours")); echo date_format($date2,"Y-m-d, H:m:s")." date2\n"; echo date_format($date4,"Y-m-d, H:m:s")." date4\n"; =======================================================
×
×
  • 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.