Re: [PHP] date() function doesn't seem to work right...

2003-12-01 Thread Chris Shiflett
--- Scott Fletcher [EMAIL PROTECTED] wrote: When I do this script, I didn't get a : and numbers in second. --snip-- date(Y-m-d H:i:s); --snip-- But when I do this script by adding a period to it, it worked okay. --snip-- date(Y-m-d H:i:s.); --snip-- Either this is a bug, or you're

Re: [PHP] date() function doesn't seem to work right...

2003-12-01 Thread Curt Zirzow
* Thus wrote Scott Fletcher ([EMAIL PROTECTED]): When I do this script, I didn't get a : and numbers in second. --snip-- date(Y-m-d H:i:s); --snip-- works fine with phpversion() 4.2.2 Curt -- If eval() is the answer, you're almost certainly asking the wrong question. -- Rasmus

Re: [PHP] Date format question

2003-11-25 Thread Manisha Sathe
Thanks to all, it help me a lot manisha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Date format question

2003-11-24 Thread Manisha Sathe
I have a date returned from MySQL in '-MM-DD' format, i want to show this date in 'DD/MM/' format using PHP, date() function does the same if i pass timestamp in int format, but how to convert into int timestamp ? e.g from '2003-11-25' to '20031125' ? and Then I believe that i can use

Re: [PHP] Date format question

2003-11-24 Thread John W. Holmes
Manisha Sathe wrote: I have a date returned from MySQL in '-MM-DD' format, i want to show this date in 'DD/MM/' format using PHP, date() function does the same if i pass timestamp in int format, but how to convert into int timestamp ? e.g from '2003-11-25' to '20031125' ? and Then I

Re: [PHP] Date format question

2003-11-24 Thread Justin French
On Tuesday, November 25, 2003, at 01:42 PM, Manisha Sathe wrote: I have a date returned from MySQL in '-MM-DD' format, i want to show this date in 'DD/MM/' format using PHP, date() function does the same if i pass timestamp in int format, but how to convert into int timestamp ? e.g

Re: [PHP] date question

2003-11-20 Thread John Nichel
Martin Cameron wrote: $ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1; for($i=0;$i$ndays;$i++) {

[PHP] date from weeknumber

2003-11-20 Thread Fredrik
Hi I want to get the last date in a week. Is there anybody who know how i can do this. something like this: function date getDateFromWeek( $week, $year){ ... ... return date; } - Petter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] date from weeknumber

2003-11-20 Thread Marco Tabini
Hey-- Maybe this will help: http://www.phparch.com/mailinglists/msg.php?a=557061 Cheers, Marco Fredrik wrote: Hi I want to get the last date in a week. Is there anybody who know how i can do this. something like this: function date getDateFromWeek( $week, $year){ ... ... return

Re: [PHP] date question

2003-11-20 Thread Ahbaid Gaffoor
Beautiful, many thanks Ahbaid. Martin Cameron wrote: $ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1;

[PHP] date question

2003-11-19 Thread Ahbaid Gaffoor
Hello all, I would like to create a php function as follows: function get_next_dates($ndays) { /* 1. get the current date 2. create an array say $results 3. Store the dates for the next $ndays in $results */ return $results } So in my main program I can include the file with

RE: [PHP] date question

2003-11-19 Thread Daniel Purdy
quote Hello all, I would like to create a php function as follows: function get_next_dates($ndays) { /* 1. get the current date 2. create an array say $results 3. Store the dates for the next $ndays in $results */ return $results } So in my main program I can

[PHP] date question

2003-11-19 Thread Martin Cameron
$ndays=14; function get_next_dates($ndays) { $today=date(m-d-Y,mktime(0,0,0,date(m),date(d),date(Y))); $forward_date=date(m-d-Y,mktime(0,0,0,date(m),date(d)+$few_days,date(Y))); print h1$today === $few_days === $forward_date/h1; for($i=0;$i$ndays;$i++) {

[PHP] date()

2003-11-14 Thread Chris Mach
Does date() give the local time of the Server? or is it based on something else? Because I have this code: echo date (F n, Y); and it should say November 14, 2003 but it echos November 11, 2003. 3 days behind. Is the date wrong on the server? or is this something I can fix? -- PHP General

RE: [PHP] date()

2003-11-14 Thread Jay Blanchard
[snip] echo date (F n, Y); [/snip] Should be; echo date(F d, Y); n - Numeric representation of a month, without leading zeros read carefully http://www.php.net/date -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] date()

2003-11-14 Thread Eugene Lee
On Fri, Nov 14, 2003 at 10:51:57AM -0500, Chris Mach wrote: : : Does date() give the local time of the Server? or is it based on : something else? The server. : Because I have this code: : : echo date (F n, Y); : : and it should say November 14, 2003 but it echos November 11, 2003. : 3 days

Re: [PHP] date()

2003-11-14 Thread Chris Shiflett
--- Chris Mach [EMAIL PROTECTED] wrote: Does date() give the local time of the Server? date() formats a timestamp, and it uses the current timestamp (whatever time() would return) when you don't specify one. Yes, an incorrect server time will give you an incorrect formatted date. Hope that

[PHP] Date to string (with mask)

2003-11-08 Thread Christian Ista
Hello, I have in a database a date field (this format yyy/mm/dd). I'd like when I display the value use an another format dd/mm/ (format in europ), could you tell me if there is a format DateString function ? Thanks, Christian, -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Date to string (with mask)

2003-11-08 Thread Filip de Waard
On Sat, 2003-11-08 at 11:45, Christian Ista wrote: Hello, I have in a database a date field (this format yyy/mm/dd). I'd like when I display the value use an another format dd/mm/ (format in europ), could you tell me if there is a format DateString function ? Thanks, Christian,

RE: [PHP] Date to string (with mask)

2003-11-08 Thread Filip de Waard
On Sat, 2003-11-08 at 15:21, Christian Ista wrote: ?php echo mysql_result($result_cat,0,CATC_DATE);? a string like that : 2003-11-07 and I'd like display 07/11/2003 I usually do: ? $query = SELECT UNIX_TIMESTAMP(datefield) as unixtime FROM table; $timestamp = mysql_result($result, unixtime);

Re: [PHP] date counting/subtracting MySQL and PHP

2003-10-21 Thread Jason Wong
On Wednesday 22 October 2003 04:32, Paul Nowosielski wrote: I need to get mysql or php to subtract the current date from $date_posted(time stamp) and return the number of days(the item has been posted) as a sum. Use the MySQL function TO_DAYS(). Not sure what you mean by as a sum. -- Jason

[PHP] date counting/subtracting MySQL and PHP

2003-10-20 Thread Paul Nowosielski
Hello, Can some lend advice regarding date functions using mysql and php please? I have a table set up like so (DESCRIBE nuke.position) hiddenid int(5) PRI NULL auto_increment id varchar(40) contact_email varchar(64) title varchar(60) salary mediumtext

[PHP] date for mysql

2003-10-17 Thread Diana Castillo
how can I format the current date and time so that I can insert it into a mysql table with an insert query? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] date for mysql[Scanned]

2003-10-17 Thread Michael Egan
To: [EMAIL PROTECTED] Subject: [PHP] date for mysql[Scanned] how can I format the current date and time so that I can insert it into a mysql table with an insert query? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List

Re: [PHP] date for mysql

2003-10-17 Thread Eugene Lee
On Fri, Oct 17, 2003 at 03:28:50PM +0200, Diana Castillo wrote: : : how can I format the current date and time so that I can insert it into a : mysql table with an insert query? That depends on the column type of your MySQL table. Is it a DATETIME? DATE? TIMESTAMP? TIME? Or just a YEAR?

[PHP] PHP Date()ing logic.....

2003-10-16 Thread Ryan A
Hi, I'm just screwing around with the date() function and timestamps but have run into a little logic problem... So far (as you can see with the below posted code) I can manipulate days,hours and minutes...any idea on how to do months and years? Lastly the goal of this is to make take all the

Re: [PHP] PHP Date()ing logic.....

2003-10-16 Thread Becoming Digital
| www.amazon.com/o/registry/EGDXEBBWTYUU - Original Message - From: Ryan A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, 16 October, 2003 15:42 Subject: [PHP] PHP Date()ing logic. Hi, I'm just screwing around with the date() function and timestamps but have run into a little

[PHP] DATE Question

2003-10-05 Thread Shaun
Hi, is there a function in PHP that will work out the amount of time(hours) beween two different dates / times? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] DATE Question

2003-10-05 Thread Chris Shiflett
--- Shaun [EMAIL PROTECTED] wrote: is there a function in PHP that will work out the amount of time(hours) beween two different dates / times? You can just subtract the timestamps the find the number of seconds between any two times. PHP has a rich set of functions to help you generate

[PHP] date brain teaser

2003-10-02 Thread Shew
Hi, I'm trying to find a formula for displaying the date for every Friday of a given year, i.e. 2003 Jan 3, 2003 Jan 10, 2003 Jan 17, 2003 etc. Any ideas? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] date brain teaser

2003-10-02 Thread J Morton
Sure -- ? $this_date = 1/1/2003; for($i=1; $i=365; $i++) { if (date(l, strtotime($this_date) == Friday)) { echo $this_date . br; } $this_date = date(n/j/Y,mktime(0,0,0,date(m, strtotime($this_date)),date(d, strtotime($this_date))+1,date(Y, strtotime($this_date; } ?

Re: [PHP] date brain teaser [fix]

2003-10-02 Thread J Morton
Sorry I had a parentheses out of place, it should have been: ? $this_date = 1/1/2003; for($i=1; $i=365; $i++) { if (date(l, strtotime($this_date)) == Friday) { echo $this_date . br; } $this_date = date(n/j/Y,mktime(0,0,0,date(m, strtotime($this_date)),date(d,

RE: [PHP] date brain teaser

2003-10-02 Thread Martin Towell
How about something similar, but look for the first Friday and then add seven days (or 604800 seconds) to get the date of the next Friday? -Original Message- From: J Morton [mailto:[EMAIL PROTECTED] Sent: Friday, 3 October 2003 11:20 AM To: Shew; [EMAIL PROTECTED] Subject: Re: [PHP] date

Re: [PHP] date brain teaser [fix]

2003-10-02 Thread Shew
Hi Justin, Most Xcellent. Thanks alot!!! Shew J Morton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sorry I had a parentheses out of place, it should have been: ? $this_date = 1/1/2003; for($i=1; $i=365; $i++) { if (date(l, strtotime($this_date)) == Friday) {

RE: [PHP] date brain teaser

2003-10-02 Thread esctoday.com | Wouter van Vliet
Message- From: Martin Towell [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 3:18 AM To: 'J Morton'; Shew; [EMAIL PROTECTED] Subject: RE: [PHP] date brain teaser How about something similar, but look for the first Friday and then add seven days (or 604800 seconds) to get the date

[PHP] Date Sorting

2003-10-01 Thread Greg Wiley
Apologies if this has been asked before but I couldn't find anything on google or any of the PHP code sites that quite fits my requirements. Here's the problem: I have a form which presents the user with a table of dates with checkboxes for a three month period, e.g. Dec 7th 14th

Re: [PHP] Date Sorting

2003-10-01 Thread Ray Hunter
Try using any of the sort functions: sort asort arsort ksort krsort ... That should get you started. -- Ray On Wed, 2003-10-01 at 07:18, Greg Wiley wrote: Apologies if this has been asked before but I couldn't find anything on google or any of the PHP code sites that quite fits my

Re: [PHP] Date Sorting

2003-10-01 Thread Jason Wong
On Wednesday 01 October 2003 21:18, Greg Wiley wrote: Apologies if this has been asked before but I couldn't find anything on google or any of the PHP code sites that quite fits my requirements. Here's the problem: I have a form which presents the user with a table of dates with checkboxes

RE: [PHP] Date Sorting

2003-10-01 Thread Greg Wiley
-Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] [problem snipped] Incorporate whatever sorting info you need into the value of the checkbox. input type=checkbox name=Dec 28 am value=insert timestamp for Dec 28 or whatever Thanks, someone

RE: [PHP] Date Sorting

2003-10-01 Thread Greg Wiley
-Original Message- From: Greg Wiley [mailto:[EMAIL PROTECTED] -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] [problem snipped] Incorporate whatever sorting info you need into the value of the checkbox. input type=checkbox name=Dec

Re: [PHP] date() is hours behind

2003-09-30 Thread PHP Webmaster
Jon Kriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well I meant just putenv('TZ=US/Eastern'); But you get the idea. -- Jon Kriek http://phpfreaks.com Jon Kriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] See the putenv() function. For example to get

Re: [PHP] date() is hours behind

2003-09-30 Thread Jon Kriek
putenv('TZ=Europe/London'); OR putenv('TZ=GMT'); -- Jon Kriek http://phpfreaks.com Php Webmaster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm in London and and my timezone is GMT, so what should I use? -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] date() is hours behind

2003-09-30 Thread PHP Webmaster
Jon Kriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] putenv('TZ=Europe/London'); OR putenv('TZ=GMT'); -- Jon Kriek http://phpfreaks.com Php Webmaster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm in London and and my timezone is GMT, so what should I

Re: [PHP] date() is hours behind

2003-09-30 Thread Curt Zirzow
* Thus wrote PHP Webmaster ([EMAIL PROTECTED]): Jon Kriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] putenv('TZ=Europe/London'); OR putenv('TZ=GMT'); -- Jon Kriek http://phpfreaks.com Php Webmaster [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

[PHP] date() is hours behind

2003-09-29 Thread PHP Webmaster
Hi all, I currently use: date(l jS F Y, g:i A); To format the current date/time to my personal preference. However, at 12:19 AM on my machine, date(l jS F Y, g:i A); shows 4:19PM... 8 hours slow :( Any ideas on how to correct this? Am I right in saying that there is a timezone problem? Any

RE: [PHP] date() is hours behind

2003-09-29 Thread Vail, Warren
Sounds like your server is set to GMT, that is, if you are located in PDT timezone. Warren Vail -Original Message- From: PHP Webmaster [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 4:23 PM To: [EMAIL PROTECTED] Subject: [PHP] date() is hours behind Hi all, I currently use

Re: [PHP] date() is hours behind

2003-09-29 Thread Jon Kriek
See the putenv() function. For example to get the correct Eastern Standard Time http://www.php.net/putenv ?php putenv('TZ=US/Eastern'); echo 'Last modified: ' . date('d/m/y H:i', getlastmod()); ? -- Jon Kriek http://phpfreaks.com Php Webmaster [EMAIL PROTECTED] wrote in message

Re: [PHP] date() is hours behind

2003-09-29 Thread Jon Kriek
Well I meant just putenv('TZ=US/Eastern'); But you get the idea. -- Jon Kriek http://phpfreaks.com Jon Kriek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] See the putenv() function. For example to get the correct Eastern Standard Time http://www.php.net/putenv ?php

[PHP] date problem

2003-09-24 Thread Shaun
Hi, Why does the following code print '00', surely it should print '08', I'm baffled! date(H, mktime(8, 0, 0, 0, 0, 0)); Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] date problem

2003-09-24 Thread Curt Zirzow
* Thus wrote Shaun ([EMAIL PROTECTED]): Hi, Why does the following code print '00', surely it should print '08', I'm baffled! date(H, mktime(8, 0, 0, 0, 0, 0)); ?php echo date(r, mktime(8,0,0,0,0,0)), \n; //Wed, 31 Dec 1969 23:59:59 + echo date(r, mktime(0,0,0,0,0,0)), \n; //Wed, 31

[PHP] date conflict with old news archive

2003-09-23 Thread \[ PAUL FERRIE \]
God i hope this is simple :) I have news bloggs section on my site. At present the news is loaded in from a txt file, most of the site is now running with most sections being loaded via mysqldb's. I would like to add the old entries to the new db that i have setup for the bloggs. My problem is

Re: [PHP] date conflict with old news archive

2003-09-23 Thread Eugene Lee
On Tue, Sep 23, 2003 at 09:01:19PM +0100, [ PAUL FERRIE ] wrote: : : God i hope this is simple :) It is. I think. :-) : I have news bloggs section on my site. At present the news is loaded in : from a txt file, most of the site is now running with most sections being : loaded via mysqldb's.

Re: [PHP] date conflict with old news archive

2003-09-23 Thread PAUL FERRIE
Cheers your a star :) Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, Sep 23, 2003 at 09:01:19PM +0100, [ PAUL FERRIE ] wrote: : : God i hope this is simple :) It is. I think. :-) : I have news bloggs section on my site. At present the news is loaded in :

Re: [PHP] Date class and Span.php

2003-09-07 Thread Mika Tuupola
On Sat, 6 Sep 2003, Nelson Goforth wrote: Date.php calls for an include of a file called Span.php, but the file does not exist in the date subdirectory. I've found some references to that file being missing, so I located a file by that name in the CVS directory and installed it. However,

[PHP] Date Confusion

2003-09-07 Thread Seth Willits
I'm having difficulty with understanding how to manipulate dates. It seems that there's no date object manipulate so we just pass around a bunch of values which is kinda of annoying. A few things I'm trying to do: 1) Turn MM/DD/YY into an array like that returned from getdate(). I don't

Re: [PHP] Date Confusion

2003-09-07 Thread Seth Willits
On Sunday, September 7, 2003, at 02:50 PM, Seth Willits wrote: A few things I'm trying to do: 1) Turn MM/DD/YY into an array like that returned from getdate(). I don't want to explode it or split it, I want to get an array just as if I used getdate() when the current day was MM/DD/YY. It

Re: [PHP] Date Confusion

2003-09-07 Thread John W. Holmes
Seth Willits wrote: 2) Have a date string representing the first of the month and manipulate it to be the last day of the previous month. You can use mktime() for this. To get the last day of a given month, just give the parameters for the zeroth day of the next month. For example, to get the

[PHP] Date class and Span.php

2003-09-06 Thread Nelson Goforth
I am trying to use the Date class and am having trouble with it. Since I'm just starting to use PEAR modules I'm not sure if I'm missing something simple or just what. Date.php calls for an include of a file called Span.php, but the file does not exist in the date subdirectory. I've found

[PHP] Date Validation, Kinda'

2003-08-21 Thread Jay Blanchard
Howdy, Has anyone written any date validation function or sequence. I have looked around, but haven't found anything. I am cobbling togather something, but was hoping to not have to re-invent the wheel. The date is formatted MMDD and is input by the user; $userCentury = substr($userDate, 0,

Re: [PHP] Date Validation, Kinda'

2003-08-21 Thread Brent Baisley
I wrote a little function to check if a date is valid. All the hard stuff is done by the checkdate() function, but function just returns a date if valid or false if not: function validDate($year,$month,$day) { if(checkdate($month,$day,$year)) { return date(Y-m-d,

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard mailto:[EMAIL PROTECTED] on Thursday, August 21, 2003 12:30 PM said: Has anyone written any date validation function or sequence. Now that I'm thinking about it, what is your goal with this? Is it to make sure the date entered is within a certain range when compared to another

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Jay Blanchard
[snip] Now that I'm thinking about it, what is your goal with this? Is it to make sure the date entered is within a certain range when compared to another date? i.e. The date entered cannot be more than absolutevalue(10 days) away from the first date or is it just to make sure it's in the proper

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Chris W. Parker
Jay Blanchard mailto:[EMAIL PROTECTED] on Thursday, August 21, 2003 1:24 PM said: It is to make sure that the user has entered a valid future date in the MMDD format into the form. (You may very well already know of these two functions and already thought of what I'm going to tell you

RE: [PHP] Date Validation, Kinda'

2003-08-21 Thread Jay Blanchard
[snip] I'm thinking this: 1. you get the date from the user 2. validate it using checkdate() 3. get the current date 4. compare the two dates to see if the users date is later than todays date 5. return true or return false Sound good? [/snip] Sounds bueno! I am just tired, had checkdate() in

[PHP] DATE insertion

2003-08-17 Thread Cesar Aracena
Hi all, First of all, thanks to everyone who helped me with the checkbox issue. I have an issue here while trying to INSERT INTO a MySQL table a date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't work. What PHP function should I use? Thanks in advanced, Cesar Aracena

Re: [PHP] DATE insertion

2003-08-17 Thread John W. Holmes
Cesar Aracena wrote: Hi all, First of all, thanks to everyone who helped me with the checkbox issue. I have an issue here while trying to INSERT INTO a MySQL table a date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't work. What PHP function should I use? date('Ymd') to put

[PHP] date frustrations

2003-07-08 Thread Shena Delian O'Brien
Ok so on a web application I needed to list the files in a directory, ordered by last modified date. I was pulling them out in an array, fetching the filemtime() for each file, and trying to order them by that date. I was using asort() to sort the files in an array so they'd list

Re: [PHP] date frustrations

2003-07-08 Thread Jason Wong
On Wednesday 09 July 2003 01:51, Shena Delian O'Brien wrote: [snip] Well I gradually figured out that the date format output by filemtime() was not an acceptable natural language date format. filemtime() was fetching dates with a dash - ex. 07-08-2003. strtotime() was making incorrect

Re: [PHP] date frustrations

2003-07-08 Thread Shena Delian O'Brien
Ahh, you're right! I had a rogue: $date = date(m-d-Y, filemtime($fn)); in there. :) Thought I got rid of all of those in testing... my organization has a standard date format and it must be dashes instead of slashes, and of course it has to be month, day, year! Jason Wong wrote: On Wednesday

RE: [PHP] date frustrations

2003-07-08 Thread Joe Harman
PROTECTED] Sent: Tuesday, July 08, 2003 1:52 PM To: [EMAIL PROTECTED] Subject: [PHP] date frustrations Ok so on a web application I needed to list the files in a directory, ordered by last modified date. I was pulling them out in an array, fetching the filemtime() for each file, and trying

Re: [PHP] date() function and timestamps

2003-07-04 Thread Jeff Harris
On Jul 3, 2003, Garrick Linn claimed that: |Hello all, | |I seem to be running into a problem where the date() function appears not |to differentiate properly between unix timestamps. | |For example, the code: | |?php | |$seconds = 1054278483; |echo $secondsbr; |echo date(d-m-Y H:m:s, $seconds);

[PHP] date() function and timestamps

2003-07-03 Thread Garrick Linn
Hello all, I seem to be running into a problem where the date() function appears not to differentiate properly between unix timestamps. For example, the code: ?php $seconds = 1054278483; echo $secondsbr; echo date(d-m-Y H:m:s, $seconds); echo brbr; $seconds = ($seconds - 60); echo $secondsbr;

Re: [PHP] date() function and timestamps

2003-07-03 Thread Philip Olson
:) You are using an m where you want an i. Regards, Philip On Thu, 3 Jul 2003, Garrick Linn wrote: Hello all, I seem to be running into a problem where the date() function appears not to differentiate properly between unix timestamps. For example, the code: ?php $seconds =

[PHP] Date/Time problem

2003-06-27 Thread Sparky Kopetzky
Well, I got the time displaying sort of right but have a length problem. See, using %T doesn't work in date() but %Z does but it returns a very long string 'Mountain Daylight Time' when all I want is 'MDT'. Is there a way around this problem other than having to edit the string date() returns??

Re: [PHP] Date/Time problem

2003-06-27 Thread Adam Voigt
echo(date('T')); Works fine for me. On Fri, 2003-06-27 at 13:03, Sparky Kopetzky wrote: Well, I got the time displaying sort of right but have a length problem. See, using %T doesn't work in date() but %Z does but it returns a very long string 'Mountain Daylight Time' when all I want is

[PHP] OOPS!!! [PHP] Date/Time problem

2003-06-27 Thread Sparky Kopetzky
Opps! I meant strftime() as I have to pass timestamp from a file. Sparky - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Sparky Kopetzky [EMAIL PROTECTED] Cc: PHP General [EMAIL PROTECTED] Sent: Friday, June 27, 2003 11:07 Subject: Re: [PHP] Date/Time problem echo(date('T

[PHP] Date problem

2003-06-23 Thread Logan McKinley
I am storing dates in an Access database in a field with a Date/Time Type the date is being generated using date(n/d/Y h:i a). It appears to be stored in Access correctly but when I output it to the page using PHP it seems to be changing. It is being stored in the database as 6/19/2003 1:44:00

Re: [PHP] Date problem

2003-06-23 Thread Mike Migurski
I am storing dates in an Access database in a field with a Date/Time Type the date is being generated using date(n/d/Y h:i a). It appears to be stored in Access correctly but when I output it to the page using PHP it seems to be changing. It is being stored in the database as 6/19/2003 1:44:00

RE: [PHP] Date problem

2003-06-23 Thread Dan Joseph
Message- From: Logan McKinley [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 5:06 PM To: [EMAIL PROTECTED] Subject: [PHP] Date problem I am storing dates in an Access database in a field with a Date/Time Type the date is being generated using date(n/d/Y h:i a). It appears to be stored

Re: [PHP] Date question

2003-05-30 Thread Shaun
, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining of that week? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP

Re: [PHP] Date question

2003-05-30 Thread Wendell Brown
On Thu, 29 May 2003 15:40:00 +0100, Shaun wrote: of course ;) but i couldn't find a reference to this particular problem... I don't think you are going to find a standard PHP function to do this. You are going to have to do something like this (I haven't tried it but I think it will do what

RE: [PHP] Date question

2003-05-30 Thread Ford, Mike [LSS]
://www.php.net ? -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining of that week? Have you tried searching

Re: [PHP] Date question

2003-05-30 Thread Jason Wong
On Thursday 29 May 2003 22:40, Shaun wrote: of course ;) Try: $start_date_ts = time(); if ('Mon' != date('D', $start_date_ts)) { $start_date_ts = strtotime(last monday); } $start_date= strftime(%Y-%m-%d, $start_date_ts); echo $start_date; Season to taste.

[PHP] Date question

2003-05-29 Thread Shaun
Hi, For a given date, how can i find out the date of the day of the begining of that week? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Date question

2003-05-29 Thread Jay Blanchard
Have you checked the date functions at http://www.php.net ? -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 6:39 AM To: [EMAIL PROTECTED] Subject: [PHP] Date question Hi, For a given date, how can i find out the date of the day of the begining

[PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Davy Obdam
Hi people, I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me.. Thanks in advance. I have been looking at the

Re: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Marek Kilimajer
Check out mysql manual, section 6.3.4 - Date and Time Functions, example $condition=''; if($GET['week']) $condition .= WEEK(date)='$_GET[week]' AND ; if($GET['year']) $condition .= YEAR(date)='$_GET[week]' AND ; and so on then use the condition: $sql = SELECT * FROM news WHERE $condition 1;

Re: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Jason Wong
On Monday 31 March 2003 22:07, Davy Obdam wrote: I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me..

[PHP] Date Problem - Last Day Of Month

2003-03-31 Thread Vinesh Hansjee
Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... What the code suppose to do is, makes a drop down box from which you can select the month, and if its the current month the box is already selected. select name=month ? for

Re: [PHP] Date Problem - Last Day Of Month

2003-03-31 Thread Liam Gibbs
Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... I'm not sure what you mean by this, but I can be a moron on this list sometimes and the clear answer usually comes to me about 2 seconds after I hit the send button. Do you

Re: [PHP] Date Problem - Last Day Of Month

2003-03-31 Thread Daniel Guerrier
change for ($i=1; $i=12; $i++) to for ($i=1; $i12; $i++) --- Vinesh Hansjee [EMAIL PROTECTED] wrote: Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... What the code suppose to do is, makes a drop down box from which

Re: [PHP] Date Problem - Last Day Of Month

2003-03-31 Thread Kevin Stone
- Original Message - From: Vinesh Hansjee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 31, 2003 6:55 AM Subject: [PHP] Date Problem - Last Day Of Month Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat

RE: [PHP] date() and mktime() functions: weeknumbers and months.

2003-03-31 Thread Davy Obdam
Thanks Jason and Marek, I was thinking to difficult, Thanks for the quick responses. Best regards, Davy Obdam -Oorspronkelijk bericht- Van: Jason Wong [mailto:[EMAIL PROTECTED] Verzonden: maandag 31 maart 2003 16:36 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] date() and mktime

RE: [PHP] date math question

2003-03-28 Thread John W. Holmes
This leads me to another question. If I have stored the date as an epoch then is there a way using PHP and MySQL to say find all the records that have been added this YEAR (not last 365 days)? SELECT * FROM table WHERE YEAR(FROM_UNIXTIME(column)) = YEAR(CUR_DATE()); Benchmark each method and

[PHP] date math question

2003-03-27 Thread Charles Kline
I am storing my dates as unix timestamp (epoch). Am I right in assuming that if I need to add or subtract days from this it is done in seconds? So for example if I have the timestamp 1041397200 and I wanted to subtract 24 hours from it I would do this: $newtime = $orig_time - 86400; Thanks,

Re: [PHP] date math question

2003-03-27 Thread Leo Spalteholz
On March 27, 2003 09:15 pm, Charles Kline wrote: I am storing my dates as unix timestamp (epoch). Am I right in assuming that if I need to add or subtract days from this it is done in seconds? yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] date math question

2003-03-27 Thread Martin Towell
I think there's problems doing that when daylight savings starts/ends Just something to keep in mind... -Original Message- From: Leo Spalteholz [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] date math question On March 27, 2003 09

Re: [PHP] date math question

2003-03-27 Thread Charles Kline
Okay cool. This leads me to another question. If I have stored the date as an epoch then is there a way using PHP and MySQL to say find all the records that have been added this YEAR (not last 365 days)? Thanks Charles On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote: On March 27,

Re: [PHP] date math question

2003-03-27 Thread Foong
hi, $start = mktime ( 0, 0, 0, 1, 1, date['Y']); // first day of this year $end = mktime ( 0, 0, 0, 12, 31, date['Y']); // last day of this year then select all record where timestamp = $start and timestamp = $end should do the job Hope this helps Foong Charles Kline [EMAIL PROTECTED]

Re: [PHP] date math question

2003-03-27 Thread Foong
sorry typo error should be: date('Y') Foong Foong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, $start = mktime ( 0, 0, 0, 1, 1, date['Y']); // first day of this year $end = mktime ( 0, 0, 0, 12, 31, date['Y']); // last day of this year then select all record where

<    1   2   3   4   5   6   7   8   9   10   >