Jump to content

Search the Community

Showing results for tags 'strtotime'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 5 results

  1. Hi all ! I need some help. I'm not a programer but I would like to solve problem with my website by myself. After upgrading PHP on server where is my web page ( www.osmrtnica.net ), i'm getting a lot of errors in my CMS. I hope that someone will have a few minutes to give a look. I have bolded text in code at line 380. And i know that is a lot of text, but what can i do. Thanks in advance. here are the errors: <br /><b>Warning</b>: main() [<a href='function.main'>function.main</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Notice</b>: Use of undefined constant date - assumed 'date' in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: strtotime() [<a href='function.strtotime'>function.strtotime</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: strtotime() [<a href='function.strtotime'>function.strtotime</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /><br /><b>Warning</b>: date() expects parameter 2 to be long, string given in <b>/home2/smiztita/public_html/cms/required/pozdravi_form.php</b> on line <b>380</b><br /> And here is a part of code where error ocurs: <div class="h3" style="height:1px;"> </div> <div style="width:450px; float:left; "> <label for="odobreno">odobreno:</label> <input type="checkbox" class="chk" name="odobreno" id="odobreno" value="1"<?php if ($row['odobreno'] == 't') { ?> checked="checked"<?php } ?> /> <label for="datum">datum:</label> <input type="text" name="datum" id="datum" class="tekst srednji" value="<?php if ($row['datum'] != '') print date('d.m.Y', date.strtotime($row['datum'])); else print date('d.m.Y'); ?>" /> <script type="text/javascript"> <!-- $(document).ready(function(){ $('#datum').datepicker({ mandatory: true, navigationAsDateFormat: true, prevText: '<M', nextText: 'M>', changeMonth: false, monthNames: ['siječanj ','veljača ','ožujak ','travanj ','svibanj ','lipanj ', 'srpanj ','kolovoz ','rujan ', 'listopad ','studeni ','prosinac '], monthNamesShort: ['sij','velj','ožu','tra','svi','lip','srp','kol','ruj','lis','stu','pro'], changeYear: false, weekHeader: '', showWeeks: true, dayNames: ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], dayNamesShort: ['ned', 'pon', 'uto', 'srij', 'čet', 'pet', 'sub'], dayNamesMin: ['N', 'P', 'U', 'S','Č', 'P', 'S'], showOtherMonths: true, numberOfMonths: 1, defaultDate: Date(<?= date('Y, m, d', strtotime($row['datum'])); ?>), // default date - Date(yyyy, mm - 1, dd), dateFormat: 'dd.mm.yy', showWeeks: true, firstDay: 1, changeFirstDay: false, closeText: 'X', prevText: '<', nextText: '>', currentText: '' }); }); //--> </script>
  2. Hi All, What do you think this should give? : echo strtotime('I'); (Thats a capital 'i') On my PHP 5.2.6 and PHP 5.3.3 and system, it seems to give a time nine hours previously: $ cat test.php <?php date_default_timezone_set('UTC'); $s="I"; echo "strtotime('$s')=".strtotime($s)."\n"; echo "date(strtotime('$s'))=".date(DATE_RFC822,strtotime($s))."\n"; echo "now=".date(DATE_RFC822)."\n"; $ php test.php strtotime('I')=1377749122 date(strtotime('I'))=Thu, 29 Aug 13 04:05:22 +0000 now=Thu, 29 Aug 13 13:05:22 +0000 Anyone know what format of date/time a single capital 'I' is matching? Cheers!
  3. Hello guys, I have a problem with the function (strtotime) So the function &week post the week count, for example, the week 1, week 2, week 3, week 4, week 5, week 6 and when the week 6 is over then jump back to the week 1. Example: http://dev.prodesign.lu/week/home.php However, he is here on week 5 and yesterday he stood on the week 0 Actually, it should in turn go 1 - 2 - 3 - 4 - 5 - 6 Here my code: <?php $week = (strtotime(date('Y-m-d 00:00:00',time())) / 7 * 86400) % 6; switch($week) { case 1: echo " <b>Woche 1</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; // case 2: echo " <b>Woche 2</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; // case 3: echo " <b>Woche 3</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; // case 4: echo " <b>Woche 4</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; // case 5: echo " <b>Woche 5</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; // case 6: echo " <b>Woche 6</b><br> <br> Montag Woche $week<br /> Dienstag Woche $week<br /> Mittwoch Woche $week<br /> Donnerstag Woche $week<br /> Freitag Woche $week<br /> Samstag Woche $week<br /> Sonntag Woche $week<br /> "; break; } ?> Thx for help
  4. Hello... I'm trying to calculate the next four Mondays, Tuesdays and Thursdays and stick each result in a select statement. So far, the best I have gotten is each date for Monday in four separate pulldowns: for($i=1; $i<=4; $i++){ echo "<select><option>"; echo date("Y-m-d", strtotime('+'.$i.' Monday')).'<br>'; echo "</select>"; } I guess the question is twofold. How do I get all of the dates in one pulldown and should I do three separate FOR statements to do it? Thanks, in advance!
  5. I'm pretty new to PHP and so far i've written a function to echo the next game in a schedule. Problem is, I want to display "Today" if there is a game today. Currently if today's date = $today, nothing gets displayed . I've tried an elseif statement inside the foreach, but with no results. If anyone could point me in the right direction, that be great. Thanks. function next_game(){ $schedule = array( 'vs. team1 ' => strtotime('17 Dec 2012'), 'vs. team2 ' => strtotime('19 Dec 2012'), '@team3 ' => strtotime('22 Dec 2012'), '@team4 ' => strtotime('4 Jan 2012') ); $today = time();// current timestamp[/background][/size][/font][/color] foreach($schedule as $place => $date){ if($date > $today) { echo date('M dS', $date)."<small>".$place."</small>"; break; } } } Output Dec 23rd<small>@FGC </small>
×
×
  • 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.