Re: [PHP] date format from a database date field

2007-05-23 Thread Daniel Brown
On 5/21/07, Mike Ryan <[EMAIL PROTECTED]> wrote: Sorry I am a bit of a newbie with php and hope this has not been aswered a million times, but here it goes I have a date base with a couple of date fields when I pull up and display the fields it show 2007-05-21. the question I have is how to con

[PHP] date format from a database date field

2007-05-23 Thread Mike Ryan
Sorry I am a bit of a newbie with php and hope this has not been aswered a million times, but here it goes I have a date base with a couple of date fields when I pull up and display the fields it show 2007-05-21. the question I have is how to convert the field to 05-21-2007? Currently the command

RE: [PHP] Date Format error

2004-11-25 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 25 November 2004 18:39, Stuart Felenstein wrote: > I'm getting a: > Parse error: parse error, unexpected '%' in > /home/mysite/public_html/userpage.php on line 120 > > $rsVJ->

[PHP] Date Format error

2004-11-25 Thread Stuart Felenstein
I'm getting a: Parse error: parse error, unexpected '%' in /home/mysite/public_html/userpage.php on line 120 Fields('DATE_FORMAT(LstUpdate,'%m/%d/%Y')'); ?> Fields('DATE_FORMAT(InitOn,'%m/%d/%Y')'); ?> Fields('DATE_FORMAT(PostStart,'%m/%d/%Y')'); ?> Using this format /syntax

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

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 f

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 believ

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

RE: [PHP] Date format from file (END)

2003-02-05 Thread ed
> I don't know of another program. As long as you write a unix timestamp > or some date format that can be parsed by strtotime(), then you can do > it this way. Use fopen()/fread() to get the last time saved in the file. > If you're using unix timestamps, just see if the current time is greater >

RE: [PHP] Date format from file

2003-02-05 Thread John W. Holmes
> I'm not using this for any database related function. What I'm trying to > do is come up with a method for scheduling processes needed for our > company that are run through command line php scripts. I'll be using cron > or to run a command that will check the date within the file and see if > t

RE: [PHP] Date format from file

2003-02-05 Thread ed
I'm not using this for any database related function. What I'm trying to do is come up with a method for scheduling processes needed for our company that are run through command line php scripts. I'll be using cron or to run a command that will check the date within the file and see if the proces

RE: [PHP] Date format from file

2003-02-05 Thread John W. Holmes
> Is it possible to read a string from a text file (i.e. > 0502031130) and be able to use that in a date function such as: > > $date = date("dmyHi", strtotime('+28 days)); > > How would I use that string as the date in the above code? What database are you using? You can probably do all of thi

Re: [PHP] Date format from file

2003-02-05 Thread Tom Rogers
Hi, Thursday, February 6, 2003, 2:41:42 AM, you wrote: ehhc> Is it possible to read a string from a text file (i.e. ehhc> 0502031130) and be able to use that in a date function such as: ehhc> $date = date("dmyHi", strtotime('+28 days)); ehhc> How would I use that string as the date in the ab

[PHP] Date format from file

2003-02-05 Thread ed
Is it possible to read a string from a text file (i.e. 0502031130) and be able to use that in a date function such as: $date = date("dmyHi", strtotime('+28 days)); How would I use that string as the date in the above code? TIA, Ed -- PHP General Mailing List (http://www.php.net/) To un

RE: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com
Thanks everyone for the helpful answers. I agree that manuals are useful, but there are times when an example works better. I took all of this information, and some details from earlier posts about dates, and produced the following function to make it easy to format dates without have to go

RE: [PHP] Date-format

2002-09-18 Thread Chuck Payne
I know everyone love to quote read the manual and forget that we[newbies] are only asking here because we need help...so here you go... You can do the following... DATE_FORMAT IS THE MySQL Command And let say you want to format your date as the following mm-dd-yy(US) or dd-mm-yy(the rest of th

Re: [PHP] Date-format

2002-09-18 Thread Jacob Miller
From http://www.mysql.com/doc/en/Using_DATE.html The format of a DATE value is '-MM-DD'. According to ANSI SQL, no other format is allowed. You should use this format in UPDATE expressions and in the WHERE clause of SELECT statements. For example: mysql> SELECT * FROM tbl_name WHERE date

Re: [PHP] Date-format

2002-09-18 Thread Support @ Fourthrealm.com
Reformatting before an inserting/updating is one option, but how would we change the mySQL database to accept the other format? Peter At 04:18 PM 9/12/2002 +0800, Jacob Miller wrote: >Why can't you just reformat it before inserting it into the db? > > $date = "31.12.2002"; > >

Re: [PHP] Date-format

2002-09-12 Thread Jacob Miller
Why can't you just reformat it before inserting it into the db? $date = "31.12.2002"; $parts = split("\.", $date); echo $parts[2]."-".$parts[1]."-".$parts[0]; - jacob At 16:13 09/12/2002, Tommi Virtanen wrote: >Well, insert format in wrong, but in Finland enter forma

Re: [PHP] Date-format

2002-09-12 Thread Tommi Virtanen
Well, insert format in wrong, but in Finland enter format is dd.mm., so I cannot use other insert format (it have to do other way). gustavus >It looks to me like the database is interpreting your date >incorrectly. Try changing the format you use to insert, -mm-dd -- PHP General Ma

Re: [PHP] Date-format

2002-09-12 Thread Jacob Miller
It looks to me like the database is interpreting your date incorrectly. Try changing the format you use to insert, -mm-dd - jacob At 15:11 09/12/2002, Tommi Virtanen wrote: >Hi! > >I have web-form, which has field (10 chars), there I enter date (format >dd.mm.). Then data saves to data

[PHP] Date-format

2002-09-11 Thread Tommi Virtanen
Hi! I have web-form, which has field (10 chars), there I enter date (format dd.mm.). Then data saves to database (date-field type is date). So everything works, but not fine. When I enter date in format ex. 31.12.2002 and save form, then I'll check what are in db (there are 2031-12-20). I

Re: [PHP] date format

2002-04-27 Thread Miguel Cruz
On Fri, 26 Apr 2002, Ananth Rajaraman wrote: > I'm trying to query a date field from mySQL and > display in a differnet format. > > the mysql date is in the format -MM-DD and I want > to convert it to DD-MM- > > how do I do that? How did you figure out anything else that you've done in

Re: [PHP] date format

2002-04-26 Thread Jason Wong
On Saturday 27 April 2002 14:43, Ananth Rajaraman wrote: > Hi all, > I'm trying to query a date field from mySQL and > display in a differnet format. > > the mysql date is in the format -MM-DD and I want > to convert it to DD-MM- > > how do I do that? Use mysql's extensive date formatting

[PHP] date format

2002-04-26 Thread Ananth Rajaraman
Hi all, I'm trying to query a date field from mySQL and display in a differnet format. the mysql date is in the format -MM-DD and I want to convert it to DD-MM- how do I do that? TIA Ananth = visit www.locustechnologies.com __ Do Yo

Re: [PHP] date format

2002-04-22 Thread Justin French
Hamish, A quick read through the date functions in the manual is worthwhile http://www.php.net/manual/en/ref.datetime.php In particular, you need to look at strtotime() and date(). strtotime() is an often overlooked function, useful for getting almost any english written date into a unix timest

[PHP] date format

2002-04-22 Thread hamish
Hello All, I have a variable in the following date format: April 11, 2002, 1:53 pm and want to get it to the following format: -mm-dd what's the best way? hamish -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date format

2002-02-01 Thread Mike Frazer
= explode(",",$phpdate); $newdate = "$d/$m/$y"; -Original Message- From: Jose [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 9:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Date format Hi all. How can I write the date in this form

Re: [PHP] Date format

2002-02-01 Thread Anas Mughal
I don't know how you are getting your (,mm,dd). But, try looking the "date" function. It should do the trick for you. --- Jose <[EMAIL PROTECTED]> wrote: > Hi all. > How can I write the date in this format (dd/mm/) > if php gives me > (,mm,dd)?? > > Thanks > -

RE: [PHP] Date format

2002-02-01 Thread Rick Emery
list($y,$m,$d) = explode(",",$phpdate); $newdate = "$d/$m/$y"; -Original Message- From: Jose [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 9:36 AM To: [EMAIL PROTECTED] Subject: [PHP] Date format Hi all. How can I write the date in this format (dd/mm/y

[PHP] Date format

2002-02-01 Thread Jose
Hi all. How can I write the date in this format (dd/mm/) if php gives me (,mm,dd)?? Thanks --Jose Fco. ( [EMAIL PROTECTED] ). OLINET, S.L. Teléfono: 952207135 - Fax: 952207600 Avda. Juan Sebastián

[PHP] DATE FORMAT ISSUES

2001-10-22 Thread Beeman
I have inserted the date into MySQL using now() in the query. However, when I retrieve the using MySQL_Date_Format in the query the time is always wrong. on the other hand, if I format the date using Date() in PHP it always makes the date DEC 31 1969 at 700PM. Please Help -- PHP General Mailin

Re: [PHP] date format for MySQL

2001-02-21 Thread Mark Maggelet
On Wed, 21 Feb 2001 11:36:02 -0800, Jerry Lake ([EMAIL PROTECTED]) wrote: >I have a field in my MySQL DB that is "DATE" > >on the form that populates this field, various >people will by typing in dates in various formats > >how to I convert say 2/21/01 or 02-21-2001 etc... >to 2001-02-21(MySQL For

[PHP] date format for MySQL

2001-02-21 Thread Jerry Lake
I have a field in my MySQL DB that is "DATE" on the form that populates this field, various people will by typing in dates in various formats how to I convert say 2/21/01 or 02-21-2001 etc... to 2001-02-21(MySQL Format) Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communication