[function.date]: Windows Does Not Support Dates Prior To Midnight (00:00:00)
I'm working with PHP in a Windows environment and ended up with the following message:
Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:Inetpubincludecommonereken.inc.php on line 29
Whether I'm working in Windows or Linux is all the same, because I'm dealing with dates prior to the year 1700 as well.
I've found the following library:
http://phplens.com/phpeverywhere/adodb_date_library
It replaces a number of standard php functions such as date(), but for strtotime() there's no replacement. Anybody got an efficient code solution for this?
View Complete Forum Thread with Replies
Related Forum Messages:
Warning: Date(): Windows Does Not Support Dates Prior To Midnight
I tried to use the date() function with the mktime(). It keeps giving warning: Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 I could use the @ to surpress the warning but I would like to know why it's happening. Take a look at this. There doesn't seem to be anything wrong with it. PHP Code:
View Replies !
45 Days Prior To Date
Been assigned a project to list entries that have been entered within the last 45 days. My database has the date column with the date format as YYYYMMDD (ex: 20070423) Been trying to write code for an SQL query to list entries that are less than 45 days from the date that is in the column I have used the dateadd() function but does the date have to be in the format as MMDDYYYY (ex: 04232007) in order for the dateadd() function to work properly.
View Replies !
Offering Dates And Booked Dates In A Table As DATE Datatype Using MYSQL.
Availability dates in offering dates except booked dates. For Example: Offering dates are : 01-09-2005 to 27-09-2005 01-11-2005 to 30-11-2005 Booked dates are : 10-09-2005 to 23-09-2005 Availability dates should be 01-09-2005 to 09-09-2005 24-09-2005 to 27-09-2005 01-11-2005 to 30-11-2005 I am storing offering dates and booked dates in a table as DATE datatype using MYSQL. So, I want the above mentioned availability dates as a result.
View Replies !
T1lib Support On Windows
I don't normally do PHP development work on Windows but I need to port an image creation tool to Windows. So I have loaded the php_gd2.dll module for image creation support but it doesn't include the t1lib functions and the code relies on the imagepsbbox(), imagepstext() and imagepsloadfont() functions. The result from gd_info() is: array(11) { ["GD Version"]=> string(27) "bundled (2.0.28 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "with freetype" ["T1Lib Support"]=> bool(false) ["GIF Read Support"]=> bool(true) ["GIF Create Support"]=> bool(true) ["JPG Support"]=> bool(true) ["PNG Support"]=> bool(true) ["WBMP Support"]=> bool(true) ["XBM Support"]=> bool(true) ["JIS-mapped Japanese Font Support"]=> bool(false) } Anyone have any idea where I can get a php_gd2.dll which includes the t1lib? I can always recode the functions to use TTF fonts instead but only want to do that as a last resort.
View Replies !
IMAP Support For PHP On Windows
I have a computer I've set up as a testing server at home and I'm having a problem trying to locate the pre-compiled IMAP libraries for PHP on Windows. According to the book "PHP & MySQL Web Development by Luke Welling and Laura Thomson", I can get the Windows build of the imap libraries from http://www.php4win.de. But in going to the website, the title bar says "php4win suspended" with an empty page. The creators of IMAP, http://www.cac.washington.edu only seems to distribute the source and you have to compile it yourself, which I don't have a compiler. Anyone know where I can find it (or an older and possibly compatible build)?
View Replies !
Type Support On Windows
I want to get PHP running with GD capability that allows me to use true type fonts, preferably to generate GIFs (the US patent has expired, but GIF support isn't due back until mid-2004 due to global patents). Has anybody got experience of running this combination on a windows box (using apache).
View Replies !
Compile Oracle Support On Linux For Windows
I'm trying to help a local non-profit organization tie in their online credit card donations to their existing vendor software, which uses Oracle 8i (8.1.7) on windows. Does anyone have any pointers on 1) how to compile oracle support into PHP, not having a linux version of Oracle, and 2) creating remote connections to Oracle.
View Replies !
Does MyAdmin Support Windows Integrated Authentication
I have installed PHP 4.x and PHPMyAdmin and all works. But I cannot get PHPMyAdmin to work with IIS and Windows Integrated Authentication. Does PhpMyAdmin work with IIS Windows Integrated Authentication or only Anonymous Access. I have searched but cannot find an answer. It is using auth_type http in the config.inc.php file.
View Replies !
Date Comparison - Checks If A Date Is In Between Two Other Dates
I'm having trouble writing a program that checks if a date is in between two other dates or not. $today = date("d-m-y"); $a = "09-09-06"; //September 9th, 2006 $c = "09-09-09"; //September 9th, 2009 if($a <= $today && $today<$c){ echo "Wee";} else{ echo "Wrong";} When I try outputting this, it outputs always outputs "Wrong" for some reason, although $today is clearly inbetween $a and $c (Sept.09'06 and Sept.09'09). Am I doing something wrong?
View Replies !
Seeing If A Date Is Between Two Dates In A Table...
I have 2 fields in my table, (date1 and date2) with date1 = 2007-08-01 and date2 = 2007-09-30 I'm trying to run this sql statement: SELECT * FROM discounts WHERE discType = 'Date Range' AND date1 >= '2007-09-15' AND date2 <= '2007-09-15' and it won't return any rows... is there a way to see if a date is between 2 days in a table? (btw.. 'Date Range' is valid.. so thats not it)
View Replies !
Calculate Dates Given Beg And End Date
I am trying to figure out how to generate a listing of dates using the following known values: begDate = 2007-07-03 endDate = 2007-08-30 recurDates = Tue|Thu Question is how do I generate the YYYY-MM-DD for each of the dates between begDate and endDate for each of the recurDates?
View Replies !
Integer Date To Readable Dates
I currently work in ASP and am in the process of moving some application across to PHP. At present I store dates in a database in numerical format 38694, which is 08/12/2005. In ASP its very easy to convert this value back into a date, but I cannot find a way to do this in PHP.
View Replies !
Calculating Dates From A Date In The Database?
I`m using this format of dates: $entry_date = strftime("%B %e, %Y %H:%M:%S", time()); And that time gets saved into the database (birth in ownedpets database): $res = mysql_query("SELECT id, owner, pet_type, pet_name, birth, food, play, datetime FROM ownedpets WHERE id=$id"); $rows = mysql_fetch_row($res); mysql_free_result($res); So let`s say in this case, the database birth value ($rows[4]) is October 19 2007 20:00:00. What do I do to tell php to check to see if the current date (hours and all don`t matter) is 21 days after the $rows[4]? Why I`m looking for this task: For the pets system, if the pet is 21 days after it`s birth, it will be an adult. But if it is not 21 days after it`s birth, it will still be a baby.
View Replies !
Dates And European Date Format
ATM my database is using an American style date format with the year coming first, then the month then the day, is there a way to set it so it goes day, month, year? Basically how it works is I got 3 drop down boxes with days, months and years in it. The user choose the desired date clicks a button and it updates the db. My problem is its has that American format and if I put it as text then I won't be able to do calculations or sorts on the date so I need it as a date. Also do I need to actually change anything in my mysql data base in regards to the date field atm I got it set as a date is there any additional things I gotta change?
View Replies !
Compare Dates With The Current Date
I have two mysql DATA (YYYYMMDD) fields, and i want to compare them with the current date on my webserver. I want the current date to be belong DATE in the interval made by my two mysql fields. Code:
View Replies !
Show Dates Between Start And End Date
can someone show me when i select a start date, number of times and frequency to show all the dates that fall between the two. Start Date 3 drop down boxes: start_mo, start_day, start_yr Number of Times List 1,2,3,4,5,..... Frequency Drop Down: - Weekly +7 - 2 Times a Month +14 - 3 Times a Month +21 - Monthly +30 Example: Start Date : 10/18/2007 # Of Times: 4 Frequency: Weekly RESULTS First Visit(1): 10/18/2007 Next Visit(2): 10/25/2007 Next Visit(3): 11/01/2007 Next Visit(4): 11/08/2007
View Replies !
Converting Dates To Mysql Date Field
Is there a way to convert a date in this format: 8-7-2002 to fit into a MySQL date field format 2002-08-07. the 8-7-2002 is a field in which users pick a date from a pop-up calendar in javascript. When I enter that date into the database, i want to convert it to the MySQL date format.....is there a way to convert it?
View Replies !
Take Todays Date, Compare It With The Dates Held In The Db
I have a db which has a field called 'date' and is set to date type. I want to be able to take todays date, compare it with the dates held in the db and print out the record with the next date in it. Say today's date is 20/09/06, the record with the next date, say 23/09/06, should be printed out. How can I do this easily. I am very new to this, and can't seem to get it right.
View Replies !
Formatting Multiple Dates Using A Function
I'm retrieving a row from a table which can have multiple dates stored in fields in the following format 񟭇-10-03 14:24:00' The fields would be named Order_Date, Despatch_Date, Packing_Date etc I want to be able to tidy them with a function I though I was getting close but turns out I'm no where near! Code:
View Replies !
Comparing Dates Using DateAdd() Function
I'm trying to restrict people to only post comments within 10 minutes from each other. So basicly what I did was make a table in a database, and when someone posts, it adds the current time to a field called "firstdate" and a time 10 minutes from now to a field called "lastdate". Now the problem is, I do not know how to compare those dates. Most likely because I used a DateAdd() function that I found on the net, and the return value is in this format: $temptime = time(); $firstdate = strftime('%Hh%M %A %d %b',$temptime); // Would return 013h25 Sunday 25 Mar $temptime = DateAdd('n',10,$temptime); $lastdate = strftime('%Hh%M %A %d %b',$temptime); // Would return 13h35 Sunday 25 Mar Does anybody understand what I'm asking for? Maybe a solution beyond all of this, an easier way if it's possible.
View Replies !
Resurrecting A Prior
I have another problem with parameters passing. One example I found while surfing has an html page with a form and the action of the form is a call to a php program; a copied the html to a single file and the php to a single file in other words, an html page was calling a php page. Again, as before, I get the windows file download popup asking if I want to save the php file being called.
View Replies !
Ip Check Prior To Post
To only admit a single ip that can post to tables, what is the correct way when given an address containing the */ to check against? $ip = $_SERVER['REMOTE_ADDR']; if ($ip==騔.33.77.*/55') {
View Replies !
Directory Listing Prior
I've been working on a script over the past two days, based on php 4.4.7, I need to be able to create a script which does the following: - Lists all Folders and Files within a specified directory. - Hyperlinked correctly forth otherwise back directories -- Hyperlink files with #top (so i can use my javascript) - The ability to choose which hdd to view via the server. (c, d, e, etc.) Well i tried php, javascript open source. and I'm really stuck. I have finally decided to seek advise otherwise help on ways to get around this.
View Replies !
Sending Headers Prior To A PNG Object
I have been working with the PEAR Image_Graph package which creates graphs that are PNG images. I want to take the image that it creates and embed it within an HTML page, however if I print anything to the screen prior to calling the graph, I get: Cannot modify header information - headers already sent by... I understand why it is doing this. I've basically created a PNG object and the header type shows that. My question is, does anyone know a viable workaround for this?
View Replies !
Concatenating Form Fields Prior To Post
I have 12 checkboxes. named box1, box2, etc. I would like to concatenate them into a pipe delimited field that I can post. I want the delimiters even if they are blank. The end result would be one field(box_data) that is posted that would be sort of as follows: box1 value||box3 value|||box6 value| .......etc I am needing this so I can post to Payflow Link with a USER field and then retrieve the value posted when Paypal posts back to my site.
View Replies !
Pdf With Unicode Support Or Arabic Characterset Support
I am working on a project that have a featre to print the news as a PDF file format. I am having a problem in generaing pdf with unicode support or Arabic characterset support. I can generat eenglish document like a charm but the probem in Arabic text. I am geting the data from the MySQL database. Anyone have any idea what to do, I search everywhere on net find some small results but still I am not been able to accomplish the task.
View Replies !
System() Function On Windows
Trying to use the system() function in my php code on a windows server 2003 system. Simple commands like: system('dir'); work fine, but Code: system('net stop spooler'); doesn't work. I guess this is a problem with windows user rights, but is there anything I can change in my script to make it work without having to start changing the windows user rights as I don't want to affect the security of windows?
View Replies !
System() Function Is Not Working In Windows
I want to encrypt a text file's content using public key of other user. I'm working in windows NT and running my php in apache server. I've installed my gnupg in c:gnupg. To encrypt the content I used the following code: PHP Code:
View Replies !
Enable Mail Function For PHP Under Windows XP
I have installed Apache2.0 and PHP4.3 on my PC under Windows XP. What are the different steps to make the mail function work. I think I have to install first a mail server, but I don't know where to find one that is relatively 'easy' to install and configure.
View Replies !
Strip Comments, Tabs And Spaces From Scripts Prior To Deployment
I write a lot of comments in my PHP scripts, and I use tabs to indent different sections for readability and to keep things tidy. Until now, my scripts have been placed in production environments with all comments and "unnecessary blanks" included. PHP works fast when it comes to parsing big scripts, but I imagine that a little script compression would not hurt at all. What I would like to do, is to keep my source in one directory structure, and generate another parallel directory structure with compressed scripts for deployment to production servers. If anyone knows about existing software for this purpose, I would be glad to hear about it. But then again, making a PHP script to do the job does not seem like a difficult thing to do. Here is what I want it to do to my PHP scripts: 1) Remove comments 2) Remove leading and tailing tabs/spaces on each line 3) Remove blank lines If I read a script file into a string ($content), I can use preg_replace() something like this: Code: // Remove comments $content = preg_replace ("/(//|#).*/m", "", $content); // Trim spaces and tabs $content = preg_replace ("/(^[40 ]+)|([40 ]+$)/m", "", $content); // Remove blank lines $content = preg_replace ("/^[40 12 ]+/m", "", $content); So far this seems to work quite well. I know that formatting text with <PRE> in my scripts will be affected by this compact method, as it removes newline/linefeed from the source code. But I hardly ever use <PRE>, so I can live with that. Does anyone have comments on this method? Can these regular expressions do unexpected things to my PHP-code, leading to either parser errors or unpredicted actions/bugs?
View Replies !
[function Mail() Windows XP]SMTP Localhost
I'm trying to send an e-mail from a .php script and ie6 returns this error: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:wampwwwPAMWDchap11emailsendmail.php on line 12 I checked php.ini (line 606): [mail function] ; For Win32 only. SMTP = localhost OTOH I didn't find "smtp_port" in php.ini. Maybe I should add :80 as port in php.ini?
View Replies !
Function Exhibits Bizarre Behavior In Windows XP
function getResponse() { Â Â $responseID = @fopen('php://stdin', 'r') or die('Cannot read from stdin'); Â Â Â while (($response = @fgets($responseID, 1024)) !== false) { Â Â Â Â Â @fclose($responseID); Â Â Â Â Â return $response; Â Â Â } } This function works just fine if using CLI PHP in a Unix platform. But this same function is required to be used in an application that is housed within a Windows XP platform, and in that platform, this function seems to ignore user input and returns null every time. Does anyone have any idea why this would specifically happen only in Windows XP using CLI PHP and nowhere else? Is there some issue involving XP's version of stdin?
View Replies !
Mail() Php Function Not Working In Windows Server 2003
I tried the mail() php function and it ends up with error message. I tried different tests with port configuration and Smtp server, though it ended up in error. Error: Code: Original - Code Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:program fileseasyphp1-7wwwmailerman.php on line 19 Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:program fileseasyphp1-7wwwmailerman.php on line 19.
View Replies !
Undefined Function Mysql_connect() - Windows XP With Service Pack2
I just installed Apache/PHP/MySQL all newest versions today on windows XP with service pack2, everything seems to be working fine, cept for when I went to connect to MySQL. I'm getting this error: Fatal error: Call to undefined function mysql_connect() in C:Program FilesApache GroupApache2htdocs ationalincconntemp.inc on line 3 line 3 of conntemp is: $db_selected = mysql_select_db('National', $link) or die('Database name incorrect'); but i know the code is good, it works fine on my linux server. can anyone tell me if i'm missing something? like a module maybe? and if so what one and where can i get it?
View Replies !
Dates In Range Falling Between Existing Dates
The latest quandry I have is that I need to: a: check whether any dates in a date range entered by a client in a form (datefrom, dateto) conflict with any existing date ranges already in the database. -this is a check to see whether the dates that a customer is trying to book are not already booked- Obviously its easy to get the numbers out of the database (i.e. 28/12/2006 or whatever format) and from the form but how to I convert this 'range' actually into a range I can loop through that will return true if any of the dates are the same (i.e. already booked)? b: is similar in that I want to check how many of the clients entered dates fall into the pre assigned high, mid and low season ranges in the database and multiply each of those days by the corresponding price.
View Replies !
Date Function
can someone tell me why rather than output todays date, the following is outputting 17th decemeber 2004? $today = date("F-j-Y, g:i a", mktime(date("g"), date("i"), date("a"), date("F"), date("j"), date("Y"))); echo $today;
View Replies !
Help Date Function
I have a real difficult problem and would really, really apreciate as much halp as possible, I am building an ecommerce site where a user can pick a delivery date and delivery zone. However, if a person lives or want their goods shipped to a particular zone then delivery schedules are different. Also, if a user orders before 10am the are eligible for next day delivery if they live in a 'delivery zone' that offers next day delivery: zone 1 : next day delivery, suturday delivery zone 2 : next day delivery, suturday delivery zone 3 : standard deliery (3 days) Users can pick dates in the future, i.e for delivery in a month etc. What i need to do is take the delivery date they have choosen then add some sort of function, delivery date + standard delivery (3days) delivery date + next day delivery (1 day) then insert it into the database as a dispatch date.
View Replies !
|