Re: [PHP] Date function kill lots time !

2012-01-05 Thread xucheng
yes,it is set in php.ini .

2012/1/5 Adam Richardson 

> On Wed, Jan 4, 2012 at 11:07 PM, xucheng wrote:
>
>> hi all,
>>   I have a webapp which track visitors, and use xhprof for profiling my
>> codes .
>>   After reading some reports produced by xhprof, i found that function
>> Date() kills most time of my app !
>>   how can this happen ? Is this function has some internal issue that i
>> should kown ?
>>   Any comment appreciate ! thanks !
>>
>> --
>> RTFSC - Read The F**king Source Code :)!
>>
>
>
> Did you set the timezone? If not, PHP raises a notice, which causes
> terrible performance (see the comment at the bottom):
> https://bugs.php.net/bug.php?id=39968
>
> Adam
>
> --
> Nephtali:  A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
>



-- 
RTFSC - Read The F**king Source Code :)!


Re: [PHP] Date function kill lots time !

2012-01-04 Thread Adam Richardson
On Wed, Jan 4, 2012 at 11:07 PM, xucheng  wrote:

> hi all,
>   I have a webapp which track visitors, and use xhprof for profiling my
> codes .
>   After reading some reports produced by xhprof, i found that function
> Date() kills most time of my app !
>   how can this happen ? Is this function has some internal issue that i
> should kown ?
>   Any comment appreciate ! thanks !
>
> --
> RTFSC - Read The F**king Source Code :)!
>


Did you set the timezone? If not, PHP raises a notice, which causes
terrible performance (see the comment at the bottom):
https://bugs.php.net/bug.php?id=39968

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com


[PHP] Date function kill lots time !

2012-01-04 Thread xucheng
hi all,
   I have a webapp which track visitors, and use xhprof for profiling my
codes .
   After reading some reports produced by xhprof, i found that function
Date() kills most time of my app !
   how can this happen ? Is this function has some internal issue that i
should kown ?
   Any comment appreciate ! thanks !

-- 
RTFSC - Read The F**king Source Code :)!


Re: [PHP] Date Function

2008-02-23 Thread Richard Heyes

$start_date =  date("Y-m-d h:i:s", strtotime($date_format));
echo $start_date;
?>

output is 2008-02-22 02:00:00

but not 2008-02-22 14:00:00

How can i get my output as 2008-02-22 14:00:00.


Use H instead of h. And try the manual.

--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date Function

2008-02-22 Thread Zoltán Németh
2008. 02. 22, péntek keltezéssel 11.48-kor VamVan ezt írta:
> Hi All,
> 
> Greetings!!
> 
> A small PHP Script for help
> 
>  $date_format = '02/22/2008 14:00:00';
> 
> $start_date =  date("Y-m-d h:i:s", strtotime($date_format));

$start_date =  date("Y-m-d H:i:s", strtotime($date_format));

RTFM: http://hu.php.net/date ;)

greets
Zoltán Németh

> echo $start_date;
> ?>
> 
> output is 2008-02-22 02:00:00
> 
> but not 2008-02-22 14:00:00
> 
> How can i get my output as 2008-02-22 14:00:00.
> 
> Thanks
> V
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date Function ][Resolved]

2008-02-22 Thread VamVan
Thanks ALL who have replied

On Fri, Feb 22, 2008 at 11:55 AM, Thiago Pojda
<[EMAIL PROTECTED]> wrote:
>
>  $start_date =  date("Y-m-d H:i:s", strtotime($date_format)); echo
>  $start_date; ?>
>
>  capital H should do it
>
>
>  -Mensagem original-
>  De: VamVan [mailto:[EMAIL PROTECTED]
>  Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48
>  Para: php-general@lists.php.net
>  Assunto: [PHP] Date Function
>
>
>
>  Hi All,
>
>  Greetings!!
>
>  A small PHP Script for help
>
>$date_format = '02/22/2008 14:00:00';
>
>  $start_date =  date("Y-m-d h:i:s", strtotime($date_format)); echo
>  $start_date; ?>
>
>  output is 2008-02-22 02:00:00
>
>  but not 2008-02-22 14:00:00
>
>  How can i get my output as 2008-02-22 14:00:00.
>
>  Thanks
>  V
>
>  --
>
>
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
>  http://www.php.net/unsub.php
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RES: [PHP] Date Function

2008-02-22 Thread Thiago Pojda
 
$start_date =  date("Y-m-d H:i:s", strtotime($date_format)); echo
$start_date; ?>

capital H should do it


-Mensagem original-
De: VamVan [mailto:[EMAIL PROTECTED] 
Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48
Para: php-general@lists.php.net
Assunto: [PHP] Date Function

Hi All,

Greetings!!

A small PHP Script for help



output is 2008-02-22 02:00:00

but not 2008-02-22 14:00:00

How can i get my output as 2008-02-22 14:00:00.

Thanks
V

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date Function

2008-02-22 Thread Andrew Ballard
On Fri, Feb 22, 2008 at 2:48 PM, VamVan <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>  Greetings!!
>
>  A small PHP Script for help
>
>$date_format = '02/22/2008 14:00:00';
>
>  $start_date =  date("Y-m-d h:i:s", strtotime($date_format));
>  echo $start_date;
>  ?>
>
>  output is 2008-02-22 02:00:00
>
>  but not 2008-02-22 14:00:00
>
>  How can i get my output as 2008-02-22 14:00:00.
>
>  Thanks
>  V
>

http://us3.php.net/date

Change the 'h' in your format to a capital H.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Date Function

2008-02-22 Thread VamVan
Hi All,

Greetings!!

A small PHP Script for help



output is 2008-02-22 02:00:00

but not 2008-02-22 14:00:00

How can i get my output as 2008-02-22 14:00:00.

Thanks
V

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] date() function

2006-11-15 Thread Ivo F.A.C. Fokkema
On Tue, 14 Nov 2006 15:11:56 -0500, Brad Fuller wrote:

> 
> 
> $prevminute = sprintf('%02s',  date("i")-1);

Or, $prevminute = str_pad(date("i")-1, 2, '0', STR_PAD_LEFT);

It's a little more code - don't ask me about the speed :)

Ivo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] date() function

2006-11-14 Thread Brad Fuller


$prevminute = sprintf('%02s',  date("i")-1);


> -Original Message-
> From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 14, 2006 1:17 PM
> To: PHP General List
> Subject: [PHP] date() function
> 
> 
> I noticed that if I do something like this:
> 
> $prevminute = date("i")-1;
> 
> ..and the current minute happens to be '05', $prevminute becomes '4'
> - I lose the padding.  How can I ensure that I retain that padding?  I
> suppose a crud solution is to run $prevminute through an if loop to see
> if it's < 10.  But I'm wondering if there's a better way.
> 
> --
> W | It's not a bug - it's an undocumented feature.
>   +
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   IT Director / SysAdmin / Websmith . 800.441.3873 x130
>   Photo Craft Imaging   . 3550 Arapahoe Ave. #6
>   http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] date() function

2006-11-14 Thread Ashley M. Kirchner


   I noticed that if I do something like this:

   $prevminute = date("i")-1;

   ..and the current minute happens to be '05', $prevminute becomes '4' 
- I lose the padding.  How can I ensure that I retain that padding?  I 
suppose a crud solution is to run $prevminute through an if loop to see 
if it's < 10.  But I'm wondering if there's a better way.


--
W | It's not a bug - it's an undocumented feature.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Imaging   . 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date Function Questions

2005-12-12 Thread Jesús Fernández
the date taken is the same as the local time of the webserver. So if it
changes that maybe the server admin's are changing it?

--
http://esu.proyectoanonimo.com
http://www.proyectoanonimo.com


RE: [PHP] Re: R: [PHP] Date Function Questions

2005-12-11 Thread Matt Babineau
System Time
> Is the system time through Linux, Apache or through the php.ini file?
> 
> 
> 
> On 12/11/05, Sebastian En3pY Zdrojewski <[EMAIL PROTECTED]> wrote:
> >
> > afaik it's the system time.
> >
> > Cheers
> >
> > En3pY
> >
> >
> > Sebastian Konstanty Zdrojewski
> >
> > 
> >
> > URL: http://www.en3py.net/
> > E-Mail: [EMAIL PROTECTED]
> >
> > 
> >
> > Le informazioni contenute in questo messaggio sono riservate e 
> > confidenziali. Il loro utilizzo è consentito esclusivamente al 
> > destinatario del messaggio, per le finalità indicate nel messaggio 
> > stesso. Qualora Lei non fosse la persona a cui il presente 
> messaggio è 
> > destinato, La invito ad eliminarlo dal Suo Sistema ed a 
> distruggere le 
> > varie copie o stampe, dandone gentilmente comunicazione. 
> Ogni utilizzo 
> > improprio è contrario ai principi del D.lgs 196/03 e alla 
> legislazione 
> > Europea (Direttiva 2002/58/CE).
> >
> > -Messaggio originale-
> > Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Inviato: lunedì 12 dicembre 2005 6.57
> > A: PHP-General
> > Oggetto: [PHP] Date Function Questions
> >
> > This maybe a dumb questions, but in php where is the 
> information taken 
> > from for the date() function?  Is it pulled through Apache or the 
> > hardware or in the php.ini file?  I am having an issue to where the 
> > time arbitraly changed one day from PST to CST.
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date:
> > 09/12/2005
> >
> >
> >
> >
> 
> 
> --
> **
> The content of this e-mail message and any attachments are 
> confidential and may be legally privileged, intended solely 
> for the addressee. If you are not the intended recipient, be 
> advised that any use, dissemination, distribution, or copying 
> of this e-mail is strictly prohibited. If you receive this 
> message in error, please notify the sender immediately by 
> reply email and destroy the message and its attachments.
> *
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: R: [PHP] Date Function Questions

2005-12-11 Thread [EMAIL PROTECTED]
Is the system time through Linux, Apache or through the php.ini file?



On 12/11/05, Sebastian En3pY Zdrojewski <[EMAIL PROTECTED]> wrote:
>
> afaik it's the system time.
>
> Cheers
>
> En3pY
>
>
> Sebastian Konstanty Zdrojewski
>
> 
>
> URL: http://www.en3py.net/
> E-Mail: [EMAIL PROTECTED]
>
> 
>
> Le informazioni contenute in questo messaggio sono riservate e
> confidenziali. Il loro utilizzo è consentito esclusivamente al
> destinatario
> del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
> non fosse la persona a cui il presente messaggio è destinato, La invito ad
> eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe,
> dandone
> gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
> del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE).
>
> -Messaggio originale-
> Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Inviato: lunedì 12 dicembre 2005 6.57
> A: PHP-General
> Oggetto: [PHP] Date Function Questions
>
> This maybe a dumb questions, but in php where is the information taken
> from
> for the date() function?  Is it pulled through Apache or the hardware or
> in
> the php.ini file?  I am having an issue to where the time arbitraly
> changed
> one day from PST to CST.
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date:
> 09/12/2005
>
>
>
>


--
**
The content of this e-mail message and any attachments are confidential and
may be legally privileged, intended solely for the addressee. If you are not
the intended recipient, be advised that any use, dissemination,
distribution, or copying of this e-mail is strictly prohibited. If you
receive this message in error, please notify the sender immediately by reply
email and destroy the message and its attachments.
*


[PHP] R: [PHP] Date Function Questions

2005-12-11 Thread Sebastian \"En3pY\" Zdrojewski
afaik it's the system time.

Cheers

En3pY 


Sebastian Konstanty Zdrojewski 



URL: http://www.en3py.net/
E-Mail: [EMAIL PROTECTED]



Le informazioni contenute in questo messaggio sono riservate e
confidenziali. Il loro utilizzo è consentito esclusivamente al destinatario
del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei
non fosse la persona a cui il presente messaggio è destinato, La invito ad
eliminarlo dal Suo Sistema ed a distruggere le varie copie o stampe, dandone
gentilmente comunicazione. Ogni utilizzo improprio è contrario ai principi
del D.lgs 196/03 e alla legislazione Europea (Direttiva 2002/58/CE). 

-Messaggio originale-
Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Inviato: lunedì 12 dicembre 2005 6.57
A: PHP-General
Oggetto: [PHP] Date Function Questions

This maybe a dumb questions, but in php where is the information taken from
for the date() function?  Is it pulled through Apache or the hardware or in
the php.ini file?  I am having an issue to where the time arbitraly changed
one day from PST to CST.

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005
 


smime.p7s
Description: S/MIME cryptographic signature


[PHP] Date Function Questions

2005-12-11 Thread [EMAIL PROTECTED]
This maybe a dumb questions, but in php where is the information taken from
for the date() function?  Is it pulled through Apache or the hardware or in
the php.ini file?  I am having an issue to where the time arbitraly changed
one day from PST to CST.


Re: [PHP] Date function and MySQL

2005-07-20 Thread kalinga
> > > Hi all.
> > >
> > > I have the week number (for example, this is the 29th week of the
> > > year and it begins on 7/17/05). Does anyone know how to obtain the
> > > first (and maybe the last) date of the week if you only know the week
> > > number of the year? Would it be better for me to obtain this in PHP
> > > or MySQL? or both?

i did a little coding, try this and give me any comments.. 

";
echo "Start Date: " . date("j-M-Y (l)",($suts));
echo "";
//518000 = 6 days in seconds
echo "Last Date: " . date("j-M-Y (l)",($suts+518400));
echo "";

?>


happy coding

vk.


> > >
> > > I have researched the archives on a few lists and I know that others
> > > have asked this same questions, but I have not found a good solution.
> > > I have also looked on MySQL's "date and time functions" page, but had
> > > little luck.
> > >
> > > Any thoughts would be appreciated.
> > > ~Philip
> > >
> > Hi Philip
> >
> > give this a go... i played around with the date functions of mysql
> >
> > select date_sub(curdate() , interval (date_format(curdate() , '%w')-1)
> > day) as firstday , date_add(curdate() , interval (7 -
> > date_format(curdate() , '%w')) day) as lastday
> >
> > it will give you the date of the monday and the sunday of the current week
> >
> > hope this solves your problem.
> >
> > Arno
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date function and MySQL

2005-07-20 Thread kalinga
this seems pretty interesting, i'm tring to write a code in php to get
those two outputs, but bit confused in counting weeks. could somebody
clear me..

"what is the first *date* of the first week of year 2005?"

is it "saturday jan 1st 2005" (assuming first week starts from jan 1
of any year)
or
is it "sunday jan 3rd 2005" (assuming first day of a week is monday)
or
anything else.

thanks

vk.



On 7/19/05, Arno Coetzee <[EMAIL PROTECTED]> wrote:
> Philip Thompson wrote:
> 
> > Hi all.
> >
> > I have the week number (for example, this is the 29th week of the
> > year and it begins on 7/17/05). Does anyone know how to obtain the
> > first (and maybe the last) date of the week if you only know the week
> > number of the year? Would it be better for me to obtain this in PHP
> > or MySQL? or both?
> >
> > I have researched the archives on a few lists and I know that others
> > have asked this same questions, but I have not found a good solution.
> > I have also looked on MySQL's "date and time functions" page, but had
> > little luck.
> >
> > Any thoughts would be appreciated.
> > ~Philip
> >
> Hi Philip
> 
> give this a go... i played around with the date functions of mysql
> 
> select date_sub(curdate() , interval (date_format(curdate() , '%w')-1)
> day) as firstday , date_add(curdate() , interval (7 -
> date_format(curdate() , '%w')) day) as lastday
> 
> it will give you the date of the monday and the sunday of the current week
> 
> hope this solves your problem.
> 
> Arno
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date function and MySQL

2005-07-19 Thread Arno Coetzee

Philip Thompson wrote:


Hi all.

I have the week number (for example, this is the 29th week of the  
year and it begins on 7/17/05). Does anyone know how to obtain the  
first (and maybe the last) date of the week if you only know the week  
number of the year? Would it be better for me to obtain this in PHP  
or MySQL? or both?


I have researched the archives on a few lists and I know that others  
have asked this same questions, but I have not found a good solution.  
I have also looked on MySQL's "date and time functions" page, but had  
little luck.


Any thoughts would be appreciated.
~Philip


Hi Philip

give this a go... i played around with the date functions of mysql

select date_sub(curdate() , interval (date_format(curdate() , '%w')-1) 
day) as firstday , date_add(curdate() , interval (7 - 
date_format(curdate() , '%w')) day) as lastday


it will give you the date of the monday and the sunday of the current week

hope this solves your problem.

Arno

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Date function and MySQL

2005-07-18 Thread Philip Thompson

Hi all.

I have the week number (for example, this is the 29th week of the  
year and it begins on 7/17/05). Does anyone know how to obtain the  
first (and maybe the last) date of the week if you only know the week  
number of the year? Would it be better for me to obtain this in PHP  
or MySQL? or both?


I have researched the archives on a few lists and I know that others  
have asked this same questions, but I have not found a good solution.  
I have also looked on MySQL's "date and time functions" page, but had  
little luck.


Any thoughts would be appreciated.
~Philip

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] date() function help

2005-03-16 Thread John Eggen
I am writing an application to allow users to enter weekly data and am
storing the data based on the year and the ISO week number.  The data
will be reported on a monthly basis and therefore I need a way to find
the ISO week number for the first full week of the month
(Monday-Sunday) and the ISO week number for the last week (starting on
the last Sunday of the month).  Does anyone have a suggestion?

Thanks!
-- 
John Eggen <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date function

2004-09-19 Thread Jordi Canals
On Sun, 19 Sep 2004 14:29:54 +0300, Magdy <[EMAIL PROTECTED]> wrote:

> my problem is with date( ) function which is display a GMT time which is different 
> from my zone with 3 hours,,,how can i correct this.

The date() function, gets the system current date/time if you don't
pass the second parameter. So, change the system time or give the
second parameter with a correct date.

You can use also the mktime() function to calculate a new date/time
for your zone.

Not tested, but something like that could work:

date('Y-m-d H:i', mktime(date(H), date(i), date(m), date(d), date(Y));

Regards,
Jordi.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] date function

2004-09-19 Thread Magdy
Hi,
i'm pleasure to write to u and hope to finde an answer..
my problem is with date( ) function which is display a GMT time which is different 
from my zone with 3 hours,,,how can i correct this.
Thanks in advance.

Magdy


[PHP] Date Function - Empty Value

2004-05-19 Thread Gabe
Environment:
PHP 4.3.6
Access DB
W2K IIS 5
I'm trying to store a date in a date/time field using the short date 
format ( m/d/ ).  For some reason it won't let me post an empty 
value to that field in the DB.  I've tried using empty quotes ( "" ) or 
NULL and I always get a datatype mismatch sql error.  So then I just 
tried submitting a date that will never be used ( e.g. 1/1/ ).  That 
works, but then when I try to read the date out of the field in the DB 
and format it using the date() function in PHP it doesn't display 
anything (which is fine with me).  I read up on the date function on the 
PHP website and valid dates are limited from 01-01-1970 to 19-01-2038 on 
windows machines.  So that explains why the function returns nothing.

So, I guess my question is this:  Is what I'm doing technically ok 
(using a date that's not in the valid range)?  Or does anyone know of an 
empty date value that I can submit to the DB?

Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date function

2004-03-05 Thread Richard Davey
Hello Jason,

Friday, March 5, 2004, 1:51:57 PM, you wrote:

JB> Hello, I am new to using the date function.  I am in the need of a
JB> script that changes an image on a web page on the first day of each
JB> month and keeps the image there until the first day of the next month.
JB> I have tried to look for something that could come close but still
JB> didn’t work.  Can you please help me?  I have a picture of a friend of
JB> mine that wants on her site a picture of her with a different colored
JB> suit depending on the month.  Example:  February = Love  color=red  Any
JB> help will be greatly appreciated.

It might be easier to think about this from a different viewpoint -
instead of worrying about changing an image based on the day of the
month, you could instead have a directory full of images for each
month of the year, i.e.:

graphics/2004/1.jpg
graphics/2004/2.jpg
graphics/2004/3.jpg

(etc)

1 = January, 2 = February, you get the idea.

Then to display the correct one on your site all you would need is:

";
?>

Or from within your HTML:

.jpg">

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Date function

2004-03-05 Thread Jason Baker
Hello, I am new to using the date function.  I am in the need of a
script that changes an image on a web page on the first day of each
month and keeps the image there until the first day of the next month.
I have tried to look for something that could come close but still
didn’t work.  Can you please help me?  I have a picture of a friend of
mine that wants on her site a picture of her with a different colored
suit depending on the month.  Example:  February = Love  color=red  Any
help will be greatly appreciated.
 
Sincerely;
 
Jason M. Baker
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
 


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

2003-12-02 Thread Wouter van Vliet
On maandag 1 december 2003 21:04 Curt Zirzow told the butterflies:
> * 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 Lerdorf, BDFL of PHP

Yep, for PHP 4.3.4 it works juust fiine. What version are you using?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 Lerdorf, BDFL of PHP

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 misrepresenting your code. Did you try
this with a test script that does nothing but echo each of these? If so,
can you show us your exact code (copy and paste to eliminate typos) and
exact output (same thing)?

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-12-01 Thread Scott Fletcher
Okay thanks...  I'll do a workaround for now until PHP get upgraded in the
near future.

"Thijs Lensselink" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Scott Fletcher wrote on maandag 1 december 2003 16:41:
>
> 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--
> :
> : Thanks,
> :  Scott
>
> On my Unix box running php 4.2.3 the output is this:
> 2003-12-01 16:25:06
> 2003-12-01 16:25:06.
>
> Looks good to me!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-12-01 Thread Thijs Lensselink
Scott Fletcher wrote on maandag 1 december 2003 16:41:

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--
: 
: Thanks,
:  Scott

On my Unix box running php 4.2.3 the output is this:
2003-12-01 16:25:06
2003-12-01 16:25:06.

Looks good to me!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-12-01 Thread Jay Blanchard
[snip]
When I do this script, I didn't get a ":" and numbers in second.
--snip--
date("Y-m-d H:i:s");
--snip--
[/snip]

When I cut and paste your code (PHP v 4.3.n) it works OK

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2003-12-01 Thread Scott Fletcher
Hi Everyone!!!

I noticed that date() function act a little funny, so I am wondering if
anyone of you have noticed this problem or not.  I'm just curious because I
wanna know if it is my issue or is it a general issue for everyone.  I'm
using PHP version 4.2.3 on Unix machine.  Please don't ask me to upgrade to
newer version because I don't have much time for it.

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--

Thanks,
 Scott

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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:
|
|";
|echo date("d-m-Y H:m:s", $seconds);
|echo "";
|
|$seconds = ($seconds - 60);
|echo "$seconds";
|echo date("d-m-Y H:m:s", $seconds);
|echo "";
|
|?>
|
|outputs
|
|1054278483
|30-05-2003 02:05:03
|
|1054278423
|30-05-2003 02:05:03
|
|I would expect the second date() to output 30-05-2003 02:04:03 as the
|second timestamp is exactly 60 seconds behind the first, but I might be
|missing something.  I see the same behavior on two redhat linux machines
|running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2
|respectively.  Any ideas?
|
|Thanks,
|
|Garrick Linn
|

As has been pointed out before, you expect incorrectly. The value of 'm'
won't change depending on what's around it. The correct formats are listed
at http://www.php.net/manual/en/function.date.php

Jeff
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date() function and timestamps

2003-07-03 Thread Garrick Linn
Doh!  Gracias.  :-)

At 11:58 PM 7/3/2003 +, Philip Olson wrote:

:)

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:
>
> 
> $seconds = 1054278483;
> echo "$seconds";
> echo date("d-m-Y H:m:s", $seconds);
> echo "";
>
> $seconds = ($seconds - 60);
> echo "$seconds";
> echo date("d-m-Y H:m:s", $seconds);
> echo "";
>
> ?>
>
> outputs
>
> 1054278483
> 30-05-2003 02:05:03
>
> 1054278423
> 30-05-2003 02:05:03
>
> I would expect the second date() to output 30-05-2003 02:04:03 as the
> second timestamp is exactly 60 seconds behind the first, but I might be
> missing something.  I see the same behavior on two redhat linux machines
> running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2
> respectively.  Any ideas?
>
> Thanks,
>
> Garrick Linn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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:
> 
>  
> $seconds = 1054278483;
> echo "$seconds";
> echo date("d-m-Y H:m:s", $seconds);
> echo "";
> 
> $seconds = ($seconds - 60);
> echo "$seconds";
> echo date("d-m-Y H:m:s", $seconds);
> echo "";
> 
> ?>
> 
> outputs
> 
> 1054278483
> 30-05-2003 02:05:03
> 
> 1054278423
> 30-05-2003 02:05:03
> 
> I would expect the second date() to output 30-05-2003 02:04:03 as the 
> second timestamp is exactly 60 seconds behind the first, but I might be 
> missing something.  I see the same behavior on two redhat linux machines 
> running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2 
> respectively.  Any ideas?
> 
> Thanks,
> 
> Garrick Linn
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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:



$seconds = 1054278483;
echo "$seconds";
echo date("d-m-Y H:m:s", $seconds);
echo "";
$seconds = ($seconds - 60);
echo "$seconds";
echo date("d-m-Y H:m:s", $seconds);
echo "";
?>

outputs

1054278483
30-05-2003 02:05:03
1054278423
30-05-2003 02:05:03
I would expect the second date() to output 30-05-2003 02:04:03 as the 
second timestamp is exactly 60 seconds behind the first, but I might be 
missing something.  I see the same behavior on two redhat linux machines 
running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2 
respectively.  Any ideas?

Thanks,

Garrick Linn



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Date Function in Php

2002-05-15 Thread Miguel Cruz

On Wed, 15 May 2002, Vinod Palan wrote:
> Do any one have date functions like that we have in asp 1) Dateadd()
> 2) Datediff()
> etc?

You might be able to get what you need with strtotime, which is a 
marvelous thing. See:

  http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html

The rest of the time, I usually pass dates off to MySQL for math. You 
don't need to be doing any database transactions; you can just take 
advantage of its date functions by sending in constants:

  select date_add("2002-05-14 15:44:21", interval 1 day);

Write a function wrapper for the mysql_query() and mysql_result() and then
it's as easy to use as strtotime or anything else.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Date Function in Php

2002-05-15 Thread Vinod Palan

hi ,
Do any one have date functions like that we have in asp 1) Dateadd()
2) Datediff()
etc?
Thanks
Vinod


--
Vinod Palan A
Calypso Technology, Inc.
[EMAIL PROTECTED]
(415) 817-2463 Phone






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date function

2002-04-19 Thread Danny Shepherd

MySQL (I assume that's the database you're inserting into) requires dates to
be sent in -MM-DD format. You appear to be sending a unix timestamp.

Try:

date("Y-m-d",time()) // Sends a MySQL style date.

or even:

$SQL = "INSERT INTO orders (Customer_Id, Order_Date) VALUES($CustID,NOW())";
// uses MySQL's builtin date function to store the current date.

HTH,

Danny.

- Original Message -
From: "Alia Mikati" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 10:28 AM
Subject: [PHP] Date function


> Hello
> I have the following SQL and I wanna insert the current date in one of
> the table fields but it's not working. Can u tell me whats the problem?
> (I'm using mysql and php)
> Thx a lot
>
> $SQL = "INSERT INTO orders (Customer_Id, Order_Date)".
>  "VALUES($CustID,date())";
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Date function

2002-04-19 Thread Alia Mikati

Hello
I have the following SQL and I wanna insert the current date in one of 
the table fields but it's not working. Can u tell me whats the problem? 
(I'm using mysql and php)
Thx a lot

$SQL = "INSERT INTO orders (Customer_Id, Order_Date)".
 "VALUES($CustID,date())";



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] date( ) - function

2002-02-05 Thread Mike Maltese

try date("H:i:s",time()).

Mike
- Original Message - 
From: "soma" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 05, 2002 12:32 AM
Subject: [PHP] date( ) - function


> i have one question
> 
> linux system's time is right but php's date () function time is wrong...
> 
> different system time and php's date( ) time
> 
> is date () function call to the system time ?
> 
> thansk
> 
> /soma
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] date( ) - function

2002-02-05 Thread soma

i have one question

linux system's time is right but php's date () function time is wrong...

different system time and php's date( ) time

is date () function call to the system time ?

thansk

/soma



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Date function

2002-01-28 Thread sundogcurt

Is this date stored in mysql by anychance?

[EMAIL PROTECTED] wrote:

>Hi All,
>
>Is there any function in PHP4.X or in Oracle8i to calculate number of
>Business days ( excluding Saturday and Sunday)  between two given dates?
>
>Thanks in advance.
>Sridhar.
>
>-Original Message-
>From: qartis [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 28, 2002 1:38 PM
>To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Subject: [PHP-DB] Re: [PHP] File uploading like hotmail
>
>
>I think you might be looking for  HTML form element.
>
>
>"Duky Yuen" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>>I want to make something like when you are attaching something to an
>>email in hotmail. I want to make something that searches your own
>>computer for files on your harddisk that you want to upload to the
>>server.
>>
>>But I don't know if this is possible. If this is possible.Can somebody
>>tell me which function I should use? Or if someone have an example...
>>please...
>>
>>Duky
>>
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>




[PHP] Date function

2002-01-28 Thread Sridhar Moparthy

Hi All,

Is there any function in PHP4.X or in Oracle8i to calculate number of
Business days ( excluding Saturday and Sunday)  between two given dates?

Thanks in advance.
Sridhar.

-Original Message-
From: qartis [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 1:38 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Re: [PHP] File uploading like hotmail


I think you might be looking for  HTML form element.


"Duky Yuen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to make something like when you are attaching something to an
> email in hotmail. I want to make something that searches your own
> computer for files on your harddisk that you want to upload to the
> server.
>
> But I don't know if this is possible. If this is possible.Can somebody
> tell me which function I should use? Or if someone have an example...
> please...
>
> Duky
>



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date function

2001-08-15 Thread Don Read


On 16-Aug-2001 David Robley wrote:
> On Thu, 16 Aug 2001 00:38, Mike Mike wrote:
>> Hello,
>> I'm pulling a date out of MySQL as 2001-10-18.
>> How do I make it print October 18 in php?
>> Thanks much
>>   --Mike
> 
> You could use the Mysql date functions to format it for you. If your date 
> field is called date and is a date type:
> 
> SELECT CONCAT(MONTHNAME(date), ' ', DAYOFMONTH(date)) AS newdate
> 

Ghaakk ... 
SELECT DATE_FORMAT(date, '%M %d') as newdate from ...

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date function

2001-08-15 Thread David Robley

On Thu, 16 Aug 2001 00:38, Mike Mike wrote:
> Hello,
> I'm pulling a date out of MySQL as 2001-10-18.
> How do I make it print October 18 in php?
> Thanks much
>   --Mike

You could use the Mysql date functions to format it for you. If your date 
field is called date and is a date type:

SELECT CONCAT(MONTHNAME(date), ' ', DAYOFMONTH(date)) AS newdate

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   I'm Not Schizophrenic, And Neither Am I.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date function

2001-08-15 Thread Brian C. Doyle

I use

$date = explode("-", $msql_date);
$date = date("d F",mktime(0,0,0,$date[1],$date[2],$date[0]));

At 08:08 AM 8/15/01 -0700, Mike Mike wrote:
>Hello,
>I'm pulling a date out of MySQL as 2001-10-18.
>How do I make it print October 18 in php?
>Thanks much
>   --Mike
>
>__
>Do You Yahoo!?
>Make international calls for as low as $.04/minute with Yahoo! Messenger
>http://phonecard.yahoo.com/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Date function

2001-08-15 Thread ReDucTor



- Original Message -
From: "Mike Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 1:08 AM
Subject: [PHP] Date function


> Hello,
> I'm pulling a date out of MySQL as 2001-10-18.
> How do I make it print October 18 in php?
> Thanks much
>   --Mike
>
> __
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Date function

2001-08-15 Thread Mike Mike

Hello,
I'm pulling a date out of MySQL as 2001-10-18.
How do I make it print October 18 in php?
Thanks much
  --Mike

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]